SlideShare a Scribd company logo
1 of 6
Download to read offline
Understanding Symbolic Artificial Intelligence
How a computer can learn arithmetics with PROLOG
It’s child’s play !
( can be read and understood by non-programmers )
Jean Rohmer
Pôle Universitaire Léonard de Vinci, Paris La Défense
Can we teach arithmetics (numbers, addition, multiplication, ..) to a computer? You tell me that a
computer already knows arithmerics, its circuits are designed for that purpose ! This is not the point.
We want to express mathematical knowledge and embed it into a computer, then ask it to solve
arithmetic problems, like : give me all couples of integer numbers X and Y such that their product
equals 80.
If we succeed, we can contemplate to express other kinds of knowledge, transmit them to a
computer, and solve automatically a variety of problems. This is the purpose of symbolic artificial
intelligence.
N.B. You eventually will see that a comprehensive knowledge about addition takes just two (2) lines
of PROLOG.
What is the knowledge about arithmetics ? How to teach it ?
We will proceed the very way young children learn to « count», when between 2 and 5 years old.
First, we teach them numbers, using « nursery rythmes » (« comptines » in french, « cuento
infantil » in spanish) :
One, two, three, four …
What is after seven ? Eight. Good !
How far can you count ? Twenty. Excellent !
Using PROLOG, we can tell the computer :
next(one, two).
next(two ,three).
next (three, four).
next (four, five).
…
next( eleven, tvelve).
/* You stop when you want
/* Indeed you can make spelling mistakes
Now, you can ask questions to the computer :
next(three, X) ?
It gently answers : X = four
next (eleven, X) ? : X = tvelve
More difficult (for children)
next (X, ten) ? : X = nine
What are the two numbers before six ?
next(X,Y), next(Y,six) ?
X = four, Y = five
next( three, four) ? : « true »
next( three, seven) . ? : « false »
next( three, dad) ? : « false »
next(X,Y) ?
X = one, Y = two
X = two, Y = three
X = three, Y = four
…
X = eleven, Y = tvelve
Not so bad. Let us come to additions.
A first solution is to teach the addition table :
sum(one, one, two)
sum(one, two, three)
…
sum(one, eleven, tvelve)
…
sum(three, five, eight)
sum(three,six, nine)
…
Then you can ask :
sum(three, four,X) ? : X= seven
Great ! And more, the computer knows already enough to perform substraction :
sum(three, X,seven) ? X = four
sum(X,Y,four) ?
X = one, Y = three
X = two, Y = two
X = three, Y = one
Well, this is not very intelligent, just learning by heart, pure memorization, but we are so proud when
our little darlings achieve it.
We prefer however when they start reasoning by themsemves : « to add three to five, I start from
five and I proceed to the next number three times : six, then seven, then eight. They have discovered
an algorithm !
But to discover it, they first must have understood what « addition » really means in real life, what is
the « semantics » of « addition ».
Mom has some candies in her bag, Dad has other ones in his bag. An addition occurs when they pour
their bags in my bag. The number of candies in my bag is the sum of the numbers in their bags.
Very soon children have some intuitions about this operation : the more candies in Mom and Dad
bags, the more candies in my bag.
Then, as rationale and practical thinking agents, they identifiy the simplest –minimal- statement of
this property : one more candy in Mom or Dad bags means one more candy in My bag.
They just discovered one of the Peano axioms. (https://en.wikipedia.org/wiki/Peano_axioms):
« if a + b = c , then a + (b+1) = (c+1) »
Or :
« to ensure that a + (b+1)= (c+1), a sufficient condition is that a + b = c »
We can express this knowledge in PROLOG :
sum(Mom_old,Dad_new,My_new):-
next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old).
The symbols :- in A :- B,C,D
can be read as : A is true if B and C and D are true
The knowledge above reads as :
If there is one more candy in Dad bag : next(Dad_old,Dad_new),
Then there is one more candy in My bag : next(My_old,My_new),
Provided that Mom bag remains unchanged : Mom_old is used in both additions.
Mathematics exist only because humans agree on this perception of the universe, around the age of
3.
Our definition of addition is recursive : one computes the addition of large numbers by increments
of one on the result of additions of smaller numbers. But this recursion cannot be infinite, it must
stop, since one has no smaller number than one.
We must ground the knowledge about sum on the only other knowledge we have, i.e. about the
succession of numbers, expressed by next(,).
The solution is –as young children find by themselves- to realize that adding one to a number is
equivalent to finding its next number, which is expressed by :
sum(X,one,Y):-next(X,Y).
Et voilà !
----------------------------------
With just these two statements -plus the next(,) declarations :
sum(X,one,Y) :- next (X,Y).
sum(Mom_old,Dad_new,My_new):-
next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old)
Our computer has learned addition.
--------------------------------------------------
With Prolog, you can check :
sum(three,four,X) ?
X = seven
sum(two,X,six) ?
X = four
sum(X,Y,five)
X=one, Y= four
X=two, Y = three
X=three, Y = two
X=four, Y = one
To run this program, you can download SWI Prolog, developed by the University of Amsterdam :
http://www.swi-prolog.org/Download.html
and create a file containing :
next(one,two).
next(two,three).
next(three,four).
next(four,five).
next(five,six).
next(six,seven).
next(seven,eight).
next(eight,nine).
next(nine,ten).
next(ten,eleven).
next(eleven,tvelve).
sum(X,one,Y):-next(X,Y).
sum(Mom_old,Dad_new,My_new):-
next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old).
To check if you have understood, try now to implement multiplication, writing « mult » so that
mult( two,three,X) answers X = six
Some help : it takes also two lines, and follows the same principles as sum : recursive definition of
mult, and grounding to previous knowledge …
You should also try to extend the bags story to multiplication.
Teach Arithmetic to Computers with PROLOG in 2 Lines

More Related Content

What's hot

빠르게훓어보는 Node.js와 Vert.x
빠르게훓어보는 Node.js와 Vert.x빠르게훓어보는 Node.js와 Vert.x
빠르게훓어보는 Node.js와 Vert.xTerry Cho
 
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드컨테이너 기술 ( Container Technology ) 발표 자료 다운로드
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드Opennaru, inc.
 
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...Amazon Web Services Korea
 
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020Ji-Woong Choi
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정Arawn Park
 
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWSKRUG - AWS한국사용자모임
 
Kafka Tutorial - introduction to the Kafka streaming platform
Kafka Tutorial - introduction to the Kafka streaming platformKafka Tutorial - introduction to the Kafka streaming platform
Kafka Tutorial - introduction to the Kafka streaming platformJean-Paul Azar
 
Ceph with CloudStack
Ceph with CloudStackCeph with CloudStack
Ceph with CloudStackShapeBlue
 
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...Amazon Web Services Korea
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon Web Services Korea
 
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Scrum Breakfast Vietnam
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareHostedbyConfluent
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Tin Linn Soe
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootKashif Ali Siddiqui
 
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020AWSKRUG - AWS한국사용자모임
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안SANG WON PARK
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudEberhard Wolff
 
AWS Support Services Overview - Spiezio
AWS Support Services Overview - SpiezioAWS Support Services Overview - Spiezio
AWS Support Services Overview - SpiezioAmazon Web Services
 
Using Terraform for AWS as the IaC tool
Using Terraform for AWS as the IaC toolUsing Terraform for AWS as the IaC tool
Using Terraform for AWS as the IaC toolLay How
 

What's hot (20)

빠르게훓어보는 Node.js와 Vert.x
빠르게훓어보는 Node.js와 Vert.x빠르게훓어보는 Node.js와 Vert.x
빠르게훓어보는 Node.js와 Vert.x
 
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드컨테이너 기술 ( Container Technology ) 발표 자료 다운로드
컨테이너 기술 ( Container Technology ) 발표 자료 다운로드
 
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...
Amazon Detective를 활용하여 AWS 환경에서 보안사고 원인 분석하기 – 임기성, AWS 보안 담당 솔루션즈 아키텍트:: AWS...
 
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020[오픈소스컨설팅] 스카우터 사용자 가이드 2020
[오픈소스컨설팅] 스카우터 사용자 가이드 2020
 
이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정이벤트 기반 분산 시스템을 향한 여정
이벤트 기반 분산 시스템을 향한 여정
 
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
AWS 기반 대규모 트래픽 견디기 - 장준엽 (구로디지털 모임) :: AWS Community Day 2017
 
Kafka Tutorial - introduction to the Kafka streaming platform
Kafka Tutorial - introduction to the Kafka streaming platformKafka Tutorial - introduction to the Kafka streaming platform
Kafka Tutorial - introduction to the Kafka streaming platform
 
Ceph with CloudStack
Ceph with CloudStackCeph with CloudStack
Ceph with CloudStack
 
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...
아마존닷컴처럼 Amazon Forecast로 시계열 예측하기 - 강지양 솔루션즈 아키텍트, AWS / 강태욱 매니저, GSSHOP :: A...
 
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
Amazon OpenSearch Deep dive - 내부구조, 성능최적화 그리고 스케일링
 
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
 
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMwareEvent Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
Event Streaming with Kafka Streams and Spring Cloud Stream | Soby Chacko, VMware
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring BootUnderstanding MicroSERVICE Architecture with Java & Spring Boot
Understanding MicroSERVICE Architecture with Java & Spring Boot
 
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020
서버리스 데이터 플로우 개발기 - 김재현 (Superb AI) :: AWS Community Day 2020
 
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
AWS Support Services Overview - Spiezio
AWS Support Services Overview - SpiezioAWS Support Services Overview - Spiezio
AWS Support Services Overview - Spiezio
 
Using Terraform for AWS as the IaC tool
Using Terraform for AWS as the IaC toolUsing Terraform for AWS as the IaC tool
Using Terraform for AWS as the IaC tool
 
Amazon CloudFront 101
Amazon CloudFront 101Amazon CloudFront 101
Amazon CloudFront 101
 

Similar to Teach Arithmetic to Computers with PROLOG in 2 Lines

Beauty and Applicability of Mathematics.pptx
Beauty and Applicability of Mathematics.pptxBeauty and Applicability of Mathematics.pptx
Beauty and Applicability of Mathematics.pptxAamirShehzad83
 
rediscover mathematics from 0 and 1
rediscover mathematics from 0 and 1rediscover mathematics from 0 and 1
rediscover mathematics from 0 and 1narayana dash
 
Cantor Infinity theorems
Cantor Infinity theoremsCantor Infinity theorems
Cantor Infinity theoremsOren Ish-Am
 
Mathematics power point 2012 13
Mathematics power point 2012 13Mathematics power point 2012 13
Mathematics power point 2012 13Kieran Ryan
 
Information Theory for Intelligent People
Information Theory for Intelligent PeopleInformation Theory for Intelligent People
Information Theory for Intelligent PeopleXequeMateShannon
 
ppt.poly.ppt
ppt.poly.pptppt.poly.ppt
ppt.poly.pptianlina
 
Computers are plain stupid (but that's just common sense).
Computers are plain stupid (but that's just common sense).Computers are plain stupid (but that's just common sense).
Computers are plain stupid (but that's just common sense).Pim Nauts
 
Module-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data scienceModule-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data sciencepujashri1975
 
AMATYC Ignite 2016 1st half Denver
AMATYC Ignite 2016 1st half DenverAMATYC Ignite 2016 1st half Denver
AMATYC Ignite 2016 1st half DenverFred Feldon
 
Evolutionary deep learning: computer vision.
Evolutionary deep learning: computer vision.Evolutionary deep learning: computer vision.
Evolutionary deep learning: computer vision.Olivier Teytaud
 
Presentation Math Workshop#May 25th New Help our teachers understa...
Presentation Math Workshop#May 25th New            Help our teachers understa...Presentation Math Workshop#May 25th New            Help our teachers understa...
Presentation Math Workshop#May 25th New Help our teachers understa...guest80c0981
 
20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...LeClubQualiteLogicielle
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of ComputationJoshua Reuben
 

Similar to Teach Arithmetic to Computers with PROLOG in 2 Lines (20)

Beauty and Applicability of Mathematics.pptx
Beauty and Applicability of Mathematics.pptxBeauty and Applicability of Mathematics.pptx
Beauty and Applicability of Mathematics.pptx
 
rediscover mathematics from 0 and 1
rediscover mathematics from 0 and 1rediscover mathematics from 0 and 1
rediscover mathematics from 0 and 1
 
Tech N Maths
Tech N MathsTech N Maths
Tech N Maths
 
Article
ArticleArticle
Article
 
Ppt Project Math
Ppt Project MathPpt Project Math
Ppt Project Math
 
Cantor Infinity theorems
Cantor Infinity theoremsCantor Infinity theorems
Cantor Infinity theorems
 
All about mathematics
All about mathematicsAll about mathematics
All about mathematics
 
Analysis.pptx
Analysis.pptxAnalysis.pptx
Analysis.pptx
 
Mathematics power point 2012 13
Mathematics power point 2012 13Mathematics power point 2012 13
Mathematics power point 2012 13
 
Information Theory for Intelligent People
Information Theory for Intelligent PeopleInformation Theory for Intelligent People
Information Theory for Intelligent People
 
ppt.poly.ppt
ppt.poly.pptppt.poly.ppt
ppt.poly.ppt
 
Introduction
IntroductionIntroduction
Introduction
 
Computers are plain stupid (but that's just common sense).
Computers are plain stupid (but that's just common sense).Computers are plain stupid (but that's just common sense).
Computers are plain stupid (but that's just common sense).
 
Module-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data scienceModule-2_Notes-with-Example for data science
Module-2_Notes-with-Example for data science
 
AMATYC Ignite 2016 1st half Denver
AMATYC Ignite 2016 1st half DenverAMATYC Ignite 2016 1st half Denver
AMATYC Ignite 2016 1st half Denver
 
Different Kinds of Probability
Different Kinds of ProbabilityDifferent Kinds of Probability
Different Kinds of Probability
 
Evolutionary deep learning: computer vision.
Evolutionary deep learning: computer vision.Evolutionary deep learning: computer vision.
Evolutionary deep learning: computer vision.
 
Presentation Math Workshop#May 25th New Help our teachers understa...
Presentation Math Workshop#May 25th New            Help our teachers understa...Presentation Math Workshop#May 25th New            Help our teachers understa...
Presentation Math Workshop#May 25th New Help our teachers understa...
 
20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...20130523 06 - The mathematics the way algorithms think / the mathematics the ...
20130523 06 - The mathematics the way algorithms think / the mathematics the ...
 
Limits of Computation
Limits of ComputationLimits of Computation
Limits of Computation
 

More from Jean Rohmer

Pub microsoft et health data hub
Pub microsoft et health data hubPub microsoft et health data hub
Pub microsoft et health data hubJean Rohmer
 
De la pub microsoft dans les articles sur le health data hub
De la pub microsoft dans les articles sur le health data hubDe la pub microsoft dans les articles sur le health data hub
De la pub microsoft dans les articles sur le health data hubJean Rohmer
 
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...Jean Rohmer
 
Compter les triangles en PROLOG
Compter les triangles en PROLOGCompter les triangles en PROLOG
Compter les triangles en PROLOGJean Rohmer
 
Ideliance mental reseau semantique
Ideliance mental reseau semantiqueIdeliance mental reseau semantique
Ideliance mental reseau semantiqueJean Rohmer
 
Semantic architectures for Artificial Intelligence
Semantic architectures for Artificial IntelligenceSemantic architectures for Artificial Intelligence
Semantic architectures for Artificial IntelligenceJean Rohmer
 
L'informatique n'est pas l'amie des données
L'informatique n'est pas l'amie des donnéesL'informatique n'est pas l'amie des données
L'informatique n'est pas l'amie des donnéesJean Rohmer
 
Construire un moteur d'inférence
Construire un moteur d'inférenceConstruire un moteur d'inférence
Construire un moteur d'inférenceJean Rohmer
 
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!Jean Rohmer
 
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...Jean Rohmer
 
Artificial Intelligence Past Present and Future
Artificial Intelligence Past Present and FutureArtificial Intelligence Past Present and Future
Artificial Intelligence Past Present and FutureJean Rohmer
 
Knowledge representation: structured or unstructured?
Knowledge representation: structured or unstructured?Knowledge representation: structured or unstructured?
Knowledge representation: structured or unstructured?Jean Rohmer
 
Semantic networks, business rules, inference engines, and complex event proc...
Semantic networks, business rules, inference engines,  and complex event proc...Semantic networks, business rules, inference engines,  and complex event proc...
Semantic networks, business rules, inference engines, and complex event proc...Jean Rohmer
 
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique Jean Rohmer
 
Ideliance semantic network 2000
Ideliance semantic network 2000Ideliance semantic network 2000
Ideliance semantic network 2000Jean Rohmer
 
Standards considered harrmful
Standards considered harrmfulStandards considered harrmful
Standards considered harrmfulJean Rohmer
 
Litteratus calculus fundamentals
Litteratus calculus fundamentalsLitteratus calculus fundamentals
Litteratus calculus fundamentalsJean Rohmer
 
Internet in 2020 rohmer open world forum 2011
Internet in 2020 rohmer open world forum 2011Internet in 2020 rohmer open world forum 2011
Internet in 2020 rohmer open world forum 2011Jean Rohmer
 

More from Jean Rohmer (18)

Pub microsoft et health data hub
Pub microsoft et health data hubPub microsoft et health data hub
Pub microsoft et health data hub
 
De la pub microsoft dans les articles sur le health data hub
De la pub microsoft dans les articles sur le health data hubDe la pub microsoft dans les articles sur le health data hub
De la pub microsoft dans les articles sur le health data hub
 
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...
Les 40 ans de l'Institut Fredrik Bull avec liens video: 40 ans d'informatique...
 
Compter les triangles en PROLOG
Compter les triangles en PROLOGCompter les triangles en PROLOG
Compter les triangles en PROLOG
 
Ideliance mental reseau semantique
Ideliance mental reseau semantiqueIdeliance mental reseau semantique
Ideliance mental reseau semantique
 
Semantic architectures for Artificial Intelligence
Semantic architectures for Artificial IntelligenceSemantic architectures for Artificial Intelligence
Semantic architectures for Artificial Intelligence
 
L'informatique n'est pas l'amie des données
L'informatique n'est pas l'amie des donnéesL'informatique n'est pas l'amie des données
L'informatique n'est pas l'amie des données
 
Construire un moteur d'inférence
Construire un moteur d'inférenceConstruire un moteur d'inférence
Construire un moteur d'inférence
 
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!
Expériences de gestion des connaissances avec IDELIANCE: supprimons le document!
 
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...
Intelligence Artificielle: résolution de problèmes en Prolog ou Prolog pour l...
 
Artificial Intelligence Past Present and Future
Artificial Intelligence Past Present and FutureArtificial Intelligence Past Present and Future
Artificial Intelligence Past Present and Future
 
Knowledge representation: structured or unstructured?
Knowledge representation: structured or unstructured?Knowledge representation: structured or unstructured?
Knowledge representation: structured or unstructured?
 
Semantic networks, business rules, inference engines, and complex event proc...
Semantic networks, business rules, inference engines,  and complex event proc...Semantic networks, business rules, inference engines,  and complex event proc...
Semantic networks, business rules, inference engines, and complex event proc...
 
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique
De l'IA au Calcul Littéraire: Pourquoi j'ai zappé le Web Sémantique
 
Ideliance semantic network 2000
Ideliance semantic network 2000Ideliance semantic network 2000
Ideliance semantic network 2000
 
Standards considered harrmful
Standards considered harrmfulStandards considered harrmful
Standards considered harrmful
 
Litteratus calculus fundamentals
Litteratus calculus fundamentalsLitteratus calculus fundamentals
Litteratus calculus fundamentals
 
Internet in 2020 rohmer open world forum 2011
Internet in 2020 rohmer open world forum 2011Internet in 2020 rohmer open world forum 2011
Internet in 2020 rohmer open world forum 2011
 

Recently uploaded

User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationColumbia Weather Systems
 
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxGood agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxSimeonChristian
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxBerniceCayabyab1
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptArshadWarsi13
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingNetHelix
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)itwameryclare
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringPrajakta Shinde
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptJoemSTuliba
 
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...D. B. S. College Kanpur
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 

Recently uploaded (20)

User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather Station
 
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxGood agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
 
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptxGenBio2 - Lesson 1 - Introduction to Genetics.pptx
GenBio2 - Lesson 1 - Introduction to Genetics.pptx
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.ppt
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical Engineering
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.ppt
 
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...
Fertilization: Sperm and the egg—collectively called the gametes—fuse togethe...
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 

Teach Arithmetic to Computers with PROLOG in 2 Lines

  • 1. Understanding Symbolic Artificial Intelligence How a computer can learn arithmetics with PROLOG It’s child’s play ! ( can be read and understood by non-programmers ) Jean Rohmer Pôle Universitaire Léonard de Vinci, Paris La Défense Can we teach arithmetics (numbers, addition, multiplication, ..) to a computer? You tell me that a computer already knows arithmerics, its circuits are designed for that purpose ! This is not the point. We want to express mathematical knowledge and embed it into a computer, then ask it to solve arithmetic problems, like : give me all couples of integer numbers X and Y such that their product equals 80. If we succeed, we can contemplate to express other kinds of knowledge, transmit them to a computer, and solve automatically a variety of problems. This is the purpose of symbolic artificial intelligence. N.B. You eventually will see that a comprehensive knowledge about addition takes just two (2) lines of PROLOG. What is the knowledge about arithmetics ? How to teach it ? We will proceed the very way young children learn to « count», when between 2 and 5 years old. First, we teach them numbers, using « nursery rythmes » (« comptines » in french, « cuento infantil » in spanish) : One, two, three, four … What is after seven ? Eight. Good ! How far can you count ? Twenty. Excellent ! Using PROLOG, we can tell the computer : next(one, two). next(two ,three). next (three, four). next (four, five). … next( eleven, tvelve).
  • 2. /* You stop when you want /* Indeed you can make spelling mistakes Now, you can ask questions to the computer : next(three, X) ? It gently answers : X = four next (eleven, X) ? : X = tvelve More difficult (for children) next (X, ten) ? : X = nine What are the two numbers before six ? next(X,Y), next(Y,six) ? X = four, Y = five next( three, four) ? : « true » next( three, seven) . ? : « false » next( three, dad) ? : « false » next(X,Y) ? X = one, Y = two X = two, Y = three X = three, Y = four … X = eleven, Y = tvelve Not so bad. Let us come to additions. A first solution is to teach the addition table : sum(one, one, two) sum(one, two, three) … sum(one, eleven, tvelve) …
  • 3. sum(three, five, eight) sum(three,six, nine) … Then you can ask : sum(three, four,X) ? : X= seven Great ! And more, the computer knows already enough to perform substraction : sum(three, X,seven) ? X = four sum(X,Y,four) ? X = one, Y = three X = two, Y = two X = three, Y = one Well, this is not very intelligent, just learning by heart, pure memorization, but we are so proud when our little darlings achieve it. We prefer however when they start reasoning by themsemves : « to add three to five, I start from five and I proceed to the next number three times : six, then seven, then eight. They have discovered an algorithm ! But to discover it, they first must have understood what « addition » really means in real life, what is the « semantics » of « addition ». Mom has some candies in her bag, Dad has other ones in his bag. An addition occurs when they pour their bags in my bag. The number of candies in my bag is the sum of the numbers in their bags. Very soon children have some intuitions about this operation : the more candies in Mom and Dad bags, the more candies in my bag. Then, as rationale and practical thinking agents, they identifiy the simplest –minimal- statement of this property : one more candy in Mom or Dad bags means one more candy in My bag. They just discovered one of the Peano axioms. (https://en.wikipedia.org/wiki/Peano_axioms): « if a + b = c , then a + (b+1) = (c+1) » Or : « to ensure that a + (b+1)= (c+1), a sufficient condition is that a + b = c » We can express this knowledge in PROLOG : sum(Mom_old,Dad_new,My_new):- next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old).
  • 4. The symbols :- in A :- B,C,D can be read as : A is true if B and C and D are true The knowledge above reads as : If there is one more candy in Dad bag : next(Dad_old,Dad_new), Then there is one more candy in My bag : next(My_old,My_new), Provided that Mom bag remains unchanged : Mom_old is used in both additions. Mathematics exist only because humans agree on this perception of the universe, around the age of 3. Our definition of addition is recursive : one computes the addition of large numbers by increments of one on the result of additions of smaller numbers. But this recursion cannot be infinite, it must stop, since one has no smaller number than one. We must ground the knowledge about sum on the only other knowledge we have, i.e. about the succession of numbers, expressed by next(,). The solution is –as young children find by themselves- to realize that adding one to a number is equivalent to finding its next number, which is expressed by : sum(X,one,Y):-next(X,Y). Et voilà ! ---------------------------------- With just these two statements -plus the next(,) declarations : sum(X,one,Y) :- next (X,Y). sum(Mom_old,Dad_new,My_new):- next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old) Our computer has learned addition. -------------------------------------------------- With Prolog, you can check : sum(three,four,X) ? X = seven sum(two,X,six) ? X = four sum(X,Y,five)
  • 5. X=one, Y= four X=two, Y = three X=three, Y = two X=four, Y = one To run this program, you can download SWI Prolog, developed by the University of Amsterdam : http://www.swi-prolog.org/Download.html and create a file containing : next(one,two). next(two,three). next(three,four). next(four,five). next(five,six). next(six,seven). next(seven,eight). next(eight,nine). next(nine,ten). next(ten,eleven). next(eleven,tvelve). sum(X,one,Y):-next(X,Y). sum(Mom_old,Dad_new,My_new):- next(Dad_old,Dad_new),next(My_old,My_new),sum(Mom_old,Dad_old,My_old). To check if you have understood, try now to implement multiplication, writing « mult » so that mult( two,three,X) answers X = six Some help : it takes also two lines, and follows the same principles as sum : recursive definition of mult, and grounding to previous knowledge … You should also try to extend the bags story to multiplication.