SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler offline
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
김선호
Clojure,
웹개발이 다가 아니에요
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Clojure 가 잘할 수 있는 영역?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Clojure 가 잘할 수 있는 영역?
Java에 비해 편리한
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
chap16.
생각하는 프로그램
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
core.logic
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
1. 첫번째 빈 칸에 숫자 배치
2. 조건 부합 여부 확인
3. 다음 칸으로 이동하고 배치
4. 반복
행, 열, 서브그리드에서 유일한 숫자인가
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
이렇게?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
이렇게!
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
원리는 별 것 아닙니다
https://www.jug.ch/events/slides/140225_Clojure_gix.pdf
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Data is Code is Data
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
명령형
vs.
선언형, 제약조건형
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
명령형
Imperative Programming
The three keys needed...
logic key functional key imperative key
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
명령형
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
선언형(논리 프로그래밍)
Logic Programming
Just one key is needed...
Magic
logic key
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
선언형(논리 프로그래밍)
Logic Programming
Just one key is needed...
Magic
logic key
miniKanren
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
What is logic programming?
semantic elements
logic programming
querylogic
variable
free
grounded
knowledge
base
proposition
predicate
term
finite
domains
constraints
deduction
depth-first
search
backtracking
unificationinduction
satisfying
assignment
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
abstract ... concrete
logic programming
query knowledge
base
deduction
satisfying
assignment
In which year was julia twice as old
clodette?
julia was born 2 years before clodette
julia was born in 1978
age 2 N, 0  age  120
year 2 N, 1978  age  2098
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
어떻게 생겨먹었나..
joy.logic.planets
http://bit.ly/2g4cfvV
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
http://lanyrd.com/2012/euroclojure/stfyd/
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Logic Variable
?q
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Fact
(relation source target)
개념상 그냥 제가 사용한 표현일 뿐,
공식 표현이 아닙니다..
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
간단한 예
(run* [q]
(conso q [] [:a]))
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(conso q [] [:a]))
=> (:a)
간단한 예
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c]))
정답이 여러개?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c]))
=> (:a :b :c)
정답이 여러개?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run 1 [q]
(membero q [:a :b :c]))
=> (:a)
정답이 여러개?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero :b [:a :b :c]))
이건 뭐지?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero :b [:a :b :c]))
=> (_0)
이건 뭐지?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero :b [:a :b :c])
(== q true))
=> (true)
단일화(unification)
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c])
(membero q [:b :c :d]))
조건이 여러개라면?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c])
(membero q [:b :c :d]))
=> (:b :c)
조건이 여러개라면?
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c])
(membero :a [:b :c q]))
이런 것도 됩니다
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
(run* [q]
(membero q [:a :b :c])
(membero :a [:b :c q]))
=> (:a)
이런 것도 됩니다
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
스도쿠로 돌아와서
조건
단일화
논리변수 초기화
답은 한 개만!
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
실행해볼까요?
joy.logic.sdokufd
http://bit.ly/2eLT44W
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
그래서.. 어디에 써먹나?
(논리적?) 데이터베이스
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
SELECT * FROM GEEKS WHERE GEEK_ID=0;
geed_id geek_name
0 Archimedes
Tuesday, 22 May 2012
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Datomic
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Datomic 질의언어: Datalog
https://en.wikipedia.org/wiki/Datalog
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
Datalog
하둡기반 데이터 처리/질의
RDF 데이터 질의 프레임워크
제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
감사합니다!
Facebook: @ksseono
Twitter: @SeonhoKim

Mais conteúdo relacionado

Destaque

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

core.logic (Clojure)

  • 1. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 김선호 Clojure, 웹개발이 다가 아니에요
  • 2. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Clojure 가 잘할 수 있는 영역?
  • 3. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Clojure 가 잘할 수 있는 영역? Java에 비해 편리한
  • 4. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 chap16. 생각하는 프로그램
  • 5. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 core.logic
  • 6. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
  • 7. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
  • 8. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 1. 첫번째 빈 칸에 숫자 배치 2. 조건 부합 여부 확인 3. 다음 칸으로 이동하고 배치 4. 반복 행, 열, 서브그리드에서 유일한 숫자인가
  • 9. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 이렇게?
  • 10. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 이렇게!
  • 11. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 원리는 별 것 아닙니다 https://www.jug.ch/events/slides/140225_Clojure_gix.pdf
  • 12. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Data is Code is Data
  • 13. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 명령형 vs. 선언형, 제약조건형
  • 14. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 명령형 Imperative Programming The three keys needed... logic key functional key imperative key
  • 15. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 명령형
  • 16. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 선언형(논리 프로그래밍) Logic Programming Just one key is needed... Magic logic key
  • 17. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 선언형(논리 프로그래밍) Logic Programming Just one key is needed... Magic logic key miniKanren
  • 18. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
  • 19. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 What is logic programming? semantic elements logic programming querylogic variable free grounded knowledge base proposition predicate term finite domains constraints deduction depth-first search backtracking unificationinduction satisfying assignment
  • 20. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 abstract ... concrete logic programming query knowledge base deduction satisfying assignment In which year was julia twice as old clodette? julia was born 2 years before clodette julia was born in 1978 age 2 N, 0  age  120 year 2 N, 1978  age  2098
  • 21. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 어떻게 생겨먹었나.. joy.logic.planets http://bit.ly/2g4cfvV
  • 22. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
  • 23. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 http://lanyrd.com/2012/euroclojure/stfyd/
  • 24. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Logic Variable ?q
  • 25. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Fact (relation source target) 개념상 그냥 제가 사용한 표현일 뿐, 공식 표현이 아닙니다..
  • 26. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 간단한 예 (run* [q] (conso q [] [:a]))
  • 27. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (conso q [] [:a])) => (:a) 간단한 예
  • 28. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c])) 정답이 여러개?
  • 29. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c])) => (:a :b :c) 정답이 여러개?
  • 30. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run 1 [q] (membero q [:a :b :c])) => (:a) 정답이 여러개?
  • 31. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero :b [:a :b :c])) 이건 뭐지?
  • 32. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero :b [:a :b :c])) => (_0) 이건 뭐지?
  • 33. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero :b [:a :b :c]) (== q true)) => (true) 단일화(unification)
  • 34. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c]) (membero q [:b :c :d])) 조건이 여러개라면?
  • 35. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c]) (membero q [:b :c :d])) => (:b :c) 조건이 여러개라면?
  • 36. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c]) (membero :a [:b :c q])) 이런 것도 됩니다
  • 37. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 (run* [q] (membero q [:a :b :c]) (membero :a [:b :c q])) => (:a) 이런 것도 됩니다
  • 38. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 스도쿠로 돌아와서 조건 단일화 논리변수 초기화 답은 한 개만!
  • 39. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 실행해볼까요? joy.logic.sdokufd http://bit.ly/2eLT44W
  • 40. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 그래서.. 어디에 써먹나? (논리적?) 데이터베이스
  • 41. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 SELECT * FROM GEEKS WHERE GEEK_ID=0; geed_id geek_name 0 Archimedes Tuesday, 22 May 2012
  • 42. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12
  • 43. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Datomic
  • 44. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Datomic 질의언어: Datalog https://en.wikipedia.org/wiki/Datalog
  • 45. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 Datalog 하둡기반 데이터 처리/질의 RDF 데이터 질의 프레임워크
  • 46. 제 5회 Lisp seminar @D2 STARTUP FACTORY, 2016.11.12 감사합니다! Facebook: @ksseono Twitter: @SeonhoKim