Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Logic Programming
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Mario Alberto Chávez
October 14, 2014
Programming
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Logic Programming
A quick exploration on Logic Programming... with Ruby and Ruby-Prolog
Mario Alberto Chávez
October 14, 2014
More Decks by Mario Alberto Chávez
See All by Mario Alberto Chávez
Ruby Internals V3
mario_chavez
0
74
Beyond the Rails Way
mario_chavez
1
140
Elm, una mejor manera de hacer frontend
mario_chavez
0
260
Rediscovering ActiveRecord
mario_chavez
2
360
Intro to Elixir
mario_chavez
0
180
From Ruby to Elixir: Developing Web Applications
mario_chavez
0
440
Pitch para Startups
mario_chavez
1
160
Understanding KPIs
mario_chavez
1
130
El nuevo comercio electrónico
mario_chavez
0
95
Other Decks in Programming
See All in Programming
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1.1k
AmebaブログはKMPから卒業します
kmars0605
0
220
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
610
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
160
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
120
golang-bob.pdf
iwatsukayura
0
130
Seven New Principles of Software Engineering
yegor256
0
210
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
330
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
ChromeでローカルLLM
ryu1013
0
160
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
560
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The untapped power of vector embeddings
frankvandijk
2
1.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
A Tale of Four Properties
chriscoyier
163
24k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.4k
A designer walks into a library…
pauljervisheath
211
25k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
530
How to build a perfect <img>
jonoalderson
1
6.1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
Transcript
Logic Programming With Ruby Mario Chavez : @mario_chavez
We do love Ruby
Ruby has a story of borrowing features from other languages
Logic Programming with Prolog
Logic Programming • We do not express what a program
should do • We do express data and queries in a specific format
Main Blocks • Facts, assertions about our domain • Rules,
express inferences about our facts • Queries, questions to be answered
Ruby-Prolog https://github.com/preston/ruby-prolog
likes['wallace', 'cheese'].fact ! likes['grommit', 'cheese'].fact! likes['wendolene', 'sheep'].fact! friend[:X, :Y] <<=
[noteq[:X,:Y], likes[:X, :Z], likes[:Y, :Z]] query(friend['wallace', 'grommit']) rp = RubyProlog::Core.new! rp.instance_eval do! end
class Family < RubyProlog::Core! def initialize! super! facts! rules! end!
! def siblings(person)! query sibling[:X, person]! end! ! def parents(child)! query parent[:X, child]! end! ! def children(parent)! query parent[parent, :Y]! end! ! private! def facts! mother["Trude", "Sally"].fact! father["Tom", "Sally"].fact! father["Tom", "Erica"].fact! father["Mike", "Tom"].fact! end! ! def rules! sibling[:X,:Y] <<= [ parent[:Z,:X], parent[:Z,:Y], noteq[:X,:Y] ]! parent[:X,:Y] <<= father[:X,:Y]! parent[:X,:Y] <<= mother[:X,:Y]! end! end! ! s = Family.new! s.siblings 'Sally'!
Not as complete as Prolog But good enough to explore
a different way to solve problems
Be curious
Explore other languages
Gracias Mario Chavez : @mario_chavez