SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
SAT/SMT solving in

Haskell
Masahiro Sakai (酒井 政裕)

Haskell Day 2016
2016-09-17
Self Introduction

Masahiro Sakai
Twitter: @masahiro_sakai
github: https://github.com/msakai/
G+: https://plus.google.com/+MasahiroSakai
Translated “Software Abstractions”
and TaPL into Japanese with colleagues
Interests: Categorical Programming,
Theorem Proving / Decision Procedures,

…
Agenda
What are SAT and SMT?
Haskell libraries for SMT solving
sbv
toysat/toysmt
Conclusion
What are

SAT and SMT?
What is SAT?
* SAT = Boolean SATisfiability problem
“Is there an assignment that makes given formula true?”
Examples:
(P∨Q)∧(P∨¬Q)∧(¬P∨¬Q) is satisfiable with

{P ↦ True, Q ↦ False}
(P∨Q)∧(P∨¬Q)∧(¬P∨¬Q)∧(¬P∨Q) is unsatisfiable
SAT is NP complete, but state-of-the-art SAT-solver can
often solve problems with millions of variables /
constraints.
What is SMT?
Weakness of SAT: Really low-level representation
Encoding problems into SAT sometimes blows-up
SAT solver cannot leverage high-level knowledge
SMT = Satisfiability Modulo Theories
An approach to overcome the weakness of SAT
Problem Example:

Is there array a, function f, integers i, j such that

“0 ≤ i ∧ i < 10 ∧ (2i+1=j ∨ read(a,i)=0) ∧
f(read(write(a,i,3), j-2)) ≠ f(j-i+1)”?
SMT Solver Impl.

SAT Solver + Theory solvers
SAT solver is responsible for Boolean reasoning
Theory solvers are responsible for handling specific functions/relations etc.
SAT
Solver
Arithmetic
Solver

+, ×, ≤
BitVector
Solver
Uninterpre
ted Function

Solver

f, g, =
Array

Solver

read, write


・・・
Some Applications

of SAT/SMT
Software/Hardware verification
Model checking, Test-case generation, …
Theorem proving
Puzzles: Sudoku, Numberlink, Nonogram, etc.
Type checking in Liquid Haskell
eg: doubles :: [{x : Int | x >= 0}]→[{x : Int | x `mod` 2 = 0}]
Program Synthesis
and more
Haskell libraries for
SMT solving
Some Haskell packages
for SMT
Binding
sbv, smtlib2, simple-smt
z3, bindings-yices, yices-easy, yices-painless
SMT solvers written in Haskell:
toysolver, Smooth
SMT-LIB2 file parser/printer
smt-lib, SmtLib
SMT-LIB2 is a standard

input/output format
for SMT solvers
SBV: SMT Based
Verification in Haskell
SMT library developed by Levent Erkok
It provides:
High-Level DSL for specifying problems in
Haskell, and
Interfaces to multiple SMT solver
backends including Z3, CVC4, Yices,
Boolector.
You can install simply using stack/cabal
“stack install sbv” or “cabal install sbv"
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
SEND

+MORE
————

MONEY
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
SMT problem is defined using Symbolic monad,
and SMT solving is performed by

sat :: Symbolic SBool → IO SatResult
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
sInteger :: String → Symbolic SInteger

creates integer variable
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
Comparison over symbolic values:
we have to use slightly difference operators like (.>=), (&&&).
Because Haskell’s (>=), (&&) returns Bool, but we want SBool.
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
val :: [SInteger] → SInteger is defined as in normal Haskell.
Thanks to the Num type class.
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
Actual constraints specification
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO SatResult
sendMoreMoney = sat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
Satisfiable. Model:
s = 9 :: Integer
e = 5 :: Integer
n = 6 :: Integer
d = 7 :: Integer
m = 1 :: Integer
o = 0 :: Integer
r = 8 :: Integer
y = 2 :: Integer
You need SMT solver Z3

to run the code.
SBV Example: “send more money”

Data.SBV.Examples.Puzzles.SendMoreMoney module
sendMoreMoney :: IO AllSatResult
sendMoreMoney = allSat $ do
ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"]
let isDigit x = x .>= 0 &&& x .<= 9
val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1)
send = val [s,e,n,d]
more = val [m,o,r,e]
money = val [m,o,n,e,y]
constrain $ bAll isDigit ds
constrain $ allDifferent ds
constrain $ s ./= 0 &&& m ./= 0
solve [send + more .== money]
By changing sat :: Symbolic SBool → IO SatResult with

allSat :: Symbolic SBool → IO AllSatResult
SBV Summary
This is only one example and sbv includes
variety of examples. You should try!
toysolver package
I’m implementing some decision procedure in Haskell
to leaning the algorithms
https://github.com/msakai/toysolver
http://hackage.haskell.org/package/toysolver
It contains some algorithms/solvers.
In particular, it contains a SAT solver ‘toysat’ and
SMT solver ‘toysmt’
Recalling Last Year …
At Proof Summit 2015,

I talked about how SAT/SMT

solver works.
At that time, I already had implemented SAT
solver ‘toysat’, but not implemented SMT solver
yet.
It triggered my motivation to implement a SMT
solver, I worked hard, and finally I did it!
http://www.slideshare.net/sakai/satsmt
toysat / toysmt
Written in pure Haskell
but implemented in very imperative way
toysat is modestly fast.
It was once the fastest among SAT solvers
written in Haskell. But now mios by Shoji
Narazaki is faster.
toysmt is slow, and has very limited features.
toysmt
toysat based SMT solver
implementation is really native and not-
efficient at all
Theories
Equality and Uninterpreted functions ✓
Linear Real Arithmetic ✓
Bit-vector (currently implementing)
Linear Integer Arithmetic, Array, etc. (not yet)
toysmt: demonstration
(set-option :produce-models true)
(set-logic QF_UFLRA)
(declare-sort U 0)
(declare-fun x () Real)
(declare-fun f (U) Real)
(declare-fun P (U) Bool)
(declare-fun g (U) U)
(declare-fun c () U)
(declare-fun d () U)
(assert (= (P c) (= (g c) c)))
(assert (ite (P c) (> x (f d)) (< x (f d))))
(check-sat)
(get-model)
(exit)
QF_UFLRA.smt2

toysmt: demonstration
$ toysmt QF_UFLRA.smt2

success
…
sat
((define-fun P ((x!1 U)) Bool

(ite (= x!1 (as @3 U)) true false))

(define-fun c () U (as @3 U))

(define-fun d () U (as @4 U))

(define-fun f ((x!1 U)) Real

(ite (= x!1 (as @4 U)) 0 (/ 555555 1)))

(define-fun g ((x!1 U)) U

(ite (= x!1 (as @3 U)) (as @3 U) (as @-1 U)))

(define-fun x () Real (/ 1 10)))
For those who do not
read SEXP
U = {@-1, @1, …, @4, …}
x = 1/10 : Real
c = @3 : U
d = @4 : U
P(x) = if x = @3 then true else false
f(x) = if x = @4 then 0 else 55555
g(x) = if x = @3 then @3 else @-1
toysmt in SMT-COMP 2016
QF_LRA (Main Track)
http://smtcomp.sourceforge.net/2016/results-QF_LRA.shtml?v=1467876482
‘toysmt’ ended up dead last.

But without wrong results! (Thanks to QuickCheck!)
toysmt: Future work
Fill the gap with state-of-the-art solvers (even a little)
There’re lots of rooms for performance improvement.
More theories: Bit-vectors, Integer arithmetic,
Array, …
More features: e.g. Proof-generation
Using ‘toysmt’ as a backend of ‘sbv'.
Re-challenge in next year's SMT-COMP competition.
Conclusion
SAT solvers are amazingly fast for solving many
combinatorial problems
SMT is an extension of SAT to handle high-level
constraints using specialized solvers.
sbv is a neat Haskell library for using SMT
solvers
toysmt is a SMT solver written in Haskell
Further readings
http://www.slideshare.net/sakai/satsmt
http://www.slideshare.net/sakai/
how-a-cdcl-sat-solver-works
Further readings
Handbook of Satisfiability
A. Biere, M. Heule, H. Van
Maaren, and T. Walsh, Eds.
IOS Press, Feb. 2009.
It is a very good book covering
variety of topics related to SAT/
SMT.

Más contenido relacionado

La actualidad más candente

SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜SSII
 
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2Preferred Networks
 
[DL輪読会]GANとエネルギーベースモデル
[DL輪読会]GANとエネルギーベースモデル[DL輪読会]GANとエネルギーベースモデル
[DL輪読会]GANとエネルギーベースモデルDeep Learning JP
 
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...Deep Learning JP
 
Learning with a Wasserstein Loss (NIPS2015)
Learning with a Wasserstein Loss (NIPS2015)Learning with a Wasserstein Loss (NIPS2015)
Learning with a Wasserstein Loss (NIPS2015)Hayato Watanabe
 
【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?Deep Learning JP
 
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.Deep Learning JP
 
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...Deep Learning JP
 
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without SupervisionDeep Learning JP
 
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...Deep Learning JP
 
モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化Yusuke Uchida
 
[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded ImaginationDeep Learning JP
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~nlab_utokyo
 
卒論プレゼンテーション -DRAFT-
卒論プレゼンテーション -DRAFT-卒論プレゼンテーション -DRAFT-
卒論プレゼンテーション -DRAFT-Tomoshige Nakamura
 
自己教師学習(Self-Supervised Learning)
自己教師学習(Self-Supervised Learning)自己教師学習(Self-Supervised Learning)
自己教師学習(Self-Supervised Learning)cvpaper. challenge
 
【DL輪読会】Variable Bitrate Neural Fields
【DL輪読会】Variable Bitrate Neural Fields【DL輪読会】Variable Bitrate Neural Fields
【DL輪読会】Variable Bitrate Neural FieldsDeep Learning JP
 
Optimizer入門&最新動向
Optimizer入門&最新動向Optimizer入門&最新動向
Optimizer入門&最新動向Motokawa Tetsuya
 
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...Deep Learning JP
 
0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)MasanoriSuganuma
 

La actualidad más candente (20)

SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
SSII2022 [TS1] Transformerの最前線〜 畳込みニューラルネットワークの先へ 〜
 
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
最新リリース:Optuna V3の全て - 2022/12/10 Optuna Meetup #2
 
[DL輪読会]GANとエネルギーベースモデル
[DL輪読会]GANとエネルギーベースモデル[DL輪読会]GANとエネルギーベースモデル
[DL輪読会]GANとエネルギーベースモデル
 
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...
[DL輪読会]Progressive Growing of GANs for Improved Quality, Stability, and Varia...
 
Learning with a Wasserstein Loss (NIPS2015)
Learning with a Wasserstein Loss (NIPS2015)Learning with a Wasserstein Loss (NIPS2015)
Learning with a Wasserstein Loss (NIPS2015)
 
【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?【DL輪読会】Can Neural Network Memorization Be Localized?
【DL輪読会】Can Neural Network Memorization Be Localized?
 
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.
[DL輪読会]深層強化学習はなぜ難しいのか?Why Deep RL fails? A brief survey of recent works.
 
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...
【DL輪読会】EPro-PnP: Generalized End-to-End Probabilistic Perspective-n-Pointsfor...
 
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
【DL輪読会】DINOv2: Learning Robust Visual Features without Supervision
 
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...
[DL輪読会] Spectral Norm Regularization for Improving the Generalizability of De...
 
モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化モデルアーキテクチャ観点からのDeep Neural Network高速化
モデルアーキテクチャ観点からのDeep Neural Network高速化
 
[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination
 
Deep Learningと画像認識   ~歴史・理論・実践~
Deep Learningと画像認識 ~歴史・理論・実践~Deep Learningと画像認識 ~歴史・理論・実践~
Deep Learningと画像認識   ~歴史・理論・実践~
 
卒論プレゼンテーション -DRAFT-
卒論プレゼンテーション -DRAFT-卒論プレゼンテーション -DRAFT-
卒論プレゼンテーション -DRAFT-
 
自己教師学習(Self-Supervised Learning)
自己教師学習(Self-Supervised Learning)自己教師学習(Self-Supervised Learning)
自己教師学習(Self-Supervised Learning)
 
【DL輪読会】Variable Bitrate Neural Fields
【DL輪読会】Variable Bitrate Neural Fields【DL輪読会】Variable Bitrate Neural Fields
【DL輪読会】Variable Bitrate Neural Fields
 
Optimizer入門&最新動向
Optimizer入門&最新動向Optimizer入門&最新動向
Optimizer入門&最新動向
 
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
【DL輪読会】Data-Efficient Reinforcement Learning with Self-Predictive Representat...
 
Mean Teacher
Mean TeacherMean Teacher
Mean Teacher
 
0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)0から理解するニューラルネットアーキテクチャサーチ(NAS)
0から理解するニューラルネットアーキテクチャサーチ(NAS)
 

Destacado

自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装Masahiro Sakai
 
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...Masahiro Sakai
 
Run-time Code Generation and Modal-ML の紹介@PLDIr#2
Run-time Code Generation and Modal-ML の紹介@PLDIr#2Run-time Code Generation and Modal-ML の紹介@PLDIr#2
Run-time Code Generation and Modal-ML の紹介@PLDIr#2Masahiro Sakai
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby projectMasahiro Sakai
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介Masahiro Sakai
 
ディープラーニングの産業応用とそれを支える技術
ディープラーニングの産業応用とそれを支える技術ディープラーニングの産業応用とそれを支える技術
ディープラーニングの産業応用とそれを支える技術Shohei Hido
 
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFAShohei Hido
 

Destacado (8)

自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装自然言語をラムダ式で解釈する体系PTQのHaskell実装
自然言語をラムダ式で解釈する体系PTQのHaskell実装
 
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
RClassify: Classifying Race Conditions in Web Applications via Deterministic ...
 
Run-time Code Generation and Modal-ML の紹介@PLDIr#2
Run-time Code Generation and Modal-ML の紹介@PLDIr#2Run-time Code Generation and Modal-ML の紹介@PLDIr#2
Run-time Code Generation and Modal-ML の紹介@PLDIr#2
 
ゼロピッチ: MOOC
ゼロピッチ: MOOCゼロピッチ: MOOC
ゼロピッチ: MOOC
 
Writing a SAT solver as a hobby project
Writing a SAT solver as a hobby projectWriting a SAT solver as a hobby project
Writing a SAT solver as a hobby project
 
自動定理証明の紹介
自動定理証明の紹介自動定理証明の紹介
自動定理証明の紹介
 
ディープラーニングの産業応用とそれを支える技術
ディープラーニングの産業応用とそれを支える技術ディープラーニングの産業応用とそれを支える技術
ディープラーニングの産業応用とそれを支える技術
 
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA
機械学習モデルフォーマットの話:さようならPMML、こんにちはPFA
 

Similar a SAT/SMT solving in Haskell

Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Mozaic Works
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right timeDavide Cerbo
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with ClojureDmitry Buzdin
 
Monadologie
MonadologieMonadologie
Monadologieleague
 
Metaprogramming in Haskell
Metaprogramming in HaskellMetaprogramming in Haskell
Metaprogramming in HaskellHiromi Ishii
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語ikdysfm
 
Send + More = Money – Let’s mash 2 monads to solve a simple CSP
Send + More = Money – Let’s mash 2 monads to solve a simple CSPSend + More = Money – Let’s mash 2 monads to solve a simple CSP
Send + More = Money – Let’s mash 2 monads to solve a simple CSPFilippo Vitale
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackVic Metcalfe
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About RubyIan Bishop
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...Philip Schwarz
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In ScalaSkills Matter
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tourSimon Proctor
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)William Narmontas
 

Similar a SAT/SMT solving in Haskell (20)

Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
Stefan Kanev: Clojure, ClojureScript and Why They're Awesome at I T.A.K.E. Un...
 
Kotlin: maybe it's the right time
Kotlin: maybe it's the right timeKotlin: maybe it's the right time
Kotlin: maybe it's the right time
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
ddd+scala
ddd+scaladdd+scala
ddd+scala
 
Monadologie
MonadologieMonadologie
Monadologie
 
Metaprogramming in Haskell
Metaprogramming in HaskellMetaprogramming in Haskell
Metaprogramming in Haskell
 
A bit about Scala
A bit about ScalaA bit about Scala
A bit about Scala
 
Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語Haskellで学ぶ関数型言語
Haskellで学ぶ関数型言語
 
Send + More = Money – Let’s mash 2 monads to solve a simple CSP
Send + More = Money – Let’s mash 2 monads to solve a simple CSPSend + More = Money – Let’s mash 2 monads to solve a simple CSP
Send + More = Money – Let’s mash 2 monads to solve a simple CSP
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
An Elephant of a Different Colour: Hack
An Elephant of a Different Colour: HackAn Elephant of a Different Colour: Hack
An Elephant of a Different Colour: Hack
 
Let’s Talk About Ruby
Let’s Talk About RubyLet’s Talk About Ruby
Let’s Talk About Ruby
 
Ns2programs
Ns2programsNs2programs
Ns2programs
 
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...The Functional Programming Triad of Folding, Scanning and Iteration - a first...
The Functional Programming Triad of Folding, Scanning and Iteration - a first...
 
Rewriting Java In Scala
Rewriting Java In ScalaRewriting Java In Scala
Rewriting Java In Scala
 
Mips1
Mips1Mips1
Mips1
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
Perl6 a whistle stop tour
Perl6 a whistle stop tourPerl6 a whistle stop tour
Perl6 a whistle stop tour
 
An Introduction to Scala (2014)
An Introduction to Scala (2014)An Introduction to Scala (2014)
An Introduction to Scala (2014)
 

Más de Masahiro Sakai

DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningMasahiro Sakai
 
Towards formal verification of neural networks
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networksMasahiro Sakai
 
関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習Masahiro Sakai
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みMasahiro Sakai
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationMasahiro Sakai
 
Aluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityMasahiro Sakai
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介Masahiro Sakai
 
How a CDCL SAT solver works
How a CDCL SAT solver worksHow a CDCL SAT solver works
How a CDCL SAT solver worksMasahiro Sakai
 
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)Masahiro Sakai
 
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...Masahiro Sakai
 
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...Masahiro Sakai
 
Relaxed Dependency Analysis
Relaxed Dependency AnalysisRelaxed Dependency Analysis
Relaxed Dependency AnalysisMasahiro Sakai
 
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...Masahiro Sakai
 
Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Masahiro Sakai
 
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Masahiro Sakai
 
Introduction to Categorical Programming
Introduction to Categorical ProgrammingIntroduction to Categorical Programming
Introduction to Categorical ProgrammingMasahiro Sakai
 
融合変換による最適化の理論的基盤と正当性 (2006-06-27)
融合変換による最適化の理論的基盤と正当性 (2006-06-27)融合変換による最適化の理論的基盤と正当性 (2006-06-27)
融合変換による最適化の理論的基盤と正当性 (2006-06-27)Masahiro Sakai
 
融合変換による最適化の理論的基盤と正当性 (2006-06-20)
融合変換による最適化の理論的基盤と正当性 (2006-06-20)融合変換による最適化の理論的基盤と正当性 (2006-06-20)
融合変換による最適化の理論的基盤と正当性 (2006-06-20)Masahiro Sakai
 
Ruby-GNOME2におけるGC問題
Ruby-GNOME2におけるGC問題Ruby-GNOME2におけるGC問題
Ruby-GNOME2におけるGC問題Masahiro Sakai
 

Más de Masahiro Sakai (20)

DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
 
Towards formal verification of neural networks
Towards formal verification of neural networksTowards formal verification of neural networks
Towards formal verification of neural networks
 
関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習関数プログラマから見たPythonと機械学習
関数プログラマから見たPythonと機械学習
 
SAT/SMTソルバの仕組み
SAT/SMTソルバの仕組みSAT/SMTソルバの仕組み
SAT/SMTソルバの仕組み
 
Introduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT EvaluationIntroduction to Max-SAT and Max-SAT Evaluation
Introduction to Max-SAT and Max-SAT Evaluation
 
Aluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through MinimalityAluminum: Principled Scenario Exploration through Minimality
Aluminum: Principled Scenario Exploration through Minimality
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介
 
How a CDCL SAT solver works
How a CDCL SAT solver worksHow a CDCL SAT solver works
How a CDCL SAT solver works
 
Omega test and beyond
Omega test and beyondOmega test and beyond
Omega test and beyond
 
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
萩野服部研究室 スキー合宿 2012 自己紹介(酒井)
 
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
“Adoption and Focus: Practical Linear Types for Imperative Programming”他の紹介@P...
 
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...“Design and Implementation of Generics for the .NET Common Language Runtime”他...
“Design and Implementation of Generics for the .NET Common Language Runtime”他...
 
Relaxed Dependency Analysis
Relaxed Dependency AnalysisRelaxed Dependency Analysis
Relaxed Dependency Analysis
 
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
“Symbolic bounds analysis of pointers, array indices, and accessed memory reg...
 
Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3Whole Program Paths 等の紹介@PLDIr#3
Whole Program Paths 等の紹介@PLDIr#3
 
Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)Introduction to Categorical Programming (Revised)
Introduction to Categorical Programming (Revised)
 
Introduction to Categorical Programming
Introduction to Categorical ProgrammingIntroduction to Categorical Programming
Introduction to Categorical Programming
 
融合変換による最適化の理論的基盤と正当性 (2006-06-27)
融合変換による最適化の理論的基盤と正当性 (2006-06-27)融合変換による最適化の理論的基盤と正当性 (2006-06-27)
融合変換による最適化の理論的基盤と正当性 (2006-06-27)
 
融合変換による最適化の理論的基盤と正当性 (2006-06-20)
融合変換による最適化の理論的基盤と正当性 (2006-06-20)融合変換による最適化の理論的基盤と正当性 (2006-06-20)
融合変換による最適化の理論的基盤と正当性 (2006-06-20)
 
Ruby-GNOME2におけるGC問題
Ruby-GNOME2におけるGC問題Ruby-GNOME2におけるGC問題
Ruby-GNOME2におけるGC問題
 

Último

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesPrabhanshu Chaturvedi
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 

Último (20)

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 

SAT/SMT solving in Haskell

  • 1. SAT/SMT solving in
 Haskell Masahiro Sakai (酒井 政裕)
 Haskell Day 2016 2016-09-17
  • 2. Self Introduction
 Masahiro Sakai Twitter: @masahiro_sakai github: https://github.com/msakai/ G+: https://plus.google.com/+MasahiroSakai Translated “Software Abstractions” and TaPL into Japanese with colleagues Interests: Categorical Programming, Theorem Proving / Decision Procedures,
 …
  • 3. Agenda What are SAT and SMT? Haskell libraries for SMT solving sbv toysat/toysmt Conclusion
  • 5. What is SAT? * SAT = Boolean SATisfiability problem “Is there an assignment that makes given formula true?” Examples: (P∨Q)∧(P∨¬Q)∧(¬P∨¬Q) is satisfiable with
 {P ↦ True, Q ↦ False} (P∨Q)∧(P∨¬Q)∧(¬P∨¬Q)∧(¬P∨Q) is unsatisfiable SAT is NP complete, but state-of-the-art SAT-solver can often solve problems with millions of variables / constraints.
  • 6. What is SMT? Weakness of SAT: Really low-level representation Encoding problems into SAT sometimes blows-up SAT solver cannot leverage high-level knowledge SMT = Satisfiability Modulo Theories An approach to overcome the weakness of SAT Problem Example:
 Is there array a, function f, integers i, j such that
 “0 ≤ i ∧ i < 10 ∧ (2i+1=j ∨ read(a,i)=0) ∧ f(read(write(a,i,3), j-2)) ≠ f(j-i+1)”?
  • 7. SMT Solver Impl.
 SAT Solver + Theory solvers SAT solver is responsible for Boolean reasoning Theory solvers are responsible for handling specific functions/relations etc. SAT Solver Arithmetic Solver
 +, ×, ≤ BitVector Solver Uninterpre ted Function
 Solver
 f, g, = Array
 Solver
 read, write 
 ・・・
  • 8. Some Applications
 of SAT/SMT Software/Hardware verification Model checking, Test-case generation, … Theorem proving Puzzles: Sudoku, Numberlink, Nonogram, etc. Type checking in Liquid Haskell eg: doubles :: [{x : Int | x >= 0}]→[{x : Int | x `mod` 2 = 0}] Program Synthesis and more
  • 10. Some Haskell packages for SMT Binding sbv, smtlib2, simple-smt z3, bindings-yices, yices-easy, yices-painless SMT solvers written in Haskell: toysolver, Smooth SMT-LIB2 file parser/printer smt-lib, SmtLib SMT-LIB2 is a standard
 input/output format for SMT solvers
  • 11. SBV: SMT Based Verification in Haskell SMT library developed by Levent Erkok It provides: High-Level DSL for specifying problems in Haskell, and Interfaces to multiple SMT solver backends including Z3, CVC4, Yices, Boolector. You can install simply using stack/cabal “stack install sbv” or “cabal install sbv"
  • 12. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] SEND
 +MORE ————
 MONEY
  • 13. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] SMT problem is defined using Symbolic monad, and SMT solving is performed by
 sat :: Symbolic SBool → IO SatResult
  • 14. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] sInteger :: String → Symbolic SInteger
 creates integer variable
  • 15. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] Comparison over symbolic values: we have to use slightly difference operators like (.>=), (&&&). Because Haskell’s (>=), (&&) returns Bool, but we want SBool.
  • 16. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] val :: [SInteger] → SInteger is defined as in normal Haskell. Thanks to the Num type class.
  • 17. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] Actual constraints specification
  • 18. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO SatResult sendMoreMoney = sat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] Satisfiable. Model: s = 9 :: Integer e = 5 :: Integer n = 6 :: Integer d = 7 :: Integer m = 1 :: Integer o = 0 :: Integer r = 8 :: Integer y = 2 :: Integer You need SMT solver Z3
 to run the code.
  • 19. SBV Example: “send more money”
 Data.SBV.Examples.Puzzles.SendMoreMoney module sendMoreMoney :: IO AllSatResult sendMoreMoney = allSat $ do ds@[s,e,n,d,m,o,r,y] <- mapM sInteger ["s", "e", "n", "d", "m", "o", "r", "y"] let isDigit x = x .>= 0 &&& x .<= 9 val xs = sum $ zipWith (*) (reverse xs) (iterate (*10) 1) send = val [s,e,n,d] more = val [m,o,r,e] money = val [m,o,n,e,y] constrain $ bAll isDigit ds constrain $ allDifferent ds constrain $ s ./= 0 &&& m ./= 0 solve [send + more .== money] By changing sat :: Symbolic SBool → IO SatResult with
 allSat :: Symbolic SBool → IO AllSatResult
  • 20. SBV Summary This is only one example and sbv includes variety of examples. You should try!
  • 21. toysolver package I’m implementing some decision procedure in Haskell to leaning the algorithms https://github.com/msakai/toysolver http://hackage.haskell.org/package/toysolver It contains some algorithms/solvers. In particular, it contains a SAT solver ‘toysat’ and SMT solver ‘toysmt’
  • 22. Recalling Last Year … At Proof Summit 2015,
 I talked about how SAT/SMT
 solver works. At that time, I already had implemented SAT solver ‘toysat’, but not implemented SMT solver yet. It triggered my motivation to implement a SMT solver, I worked hard, and finally I did it! http://www.slideshare.net/sakai/satsmt
  • 23. toysat / toysmt Written in pure Haskell but implemented in very imperative way toysat is modestly fast. It was once the fastest among SAT solvers written in Haskell. But now mios by Shoji Narazaki is faster. toysmt is slow, and has very limited features.
  • 24. toysmt toysat based SMT solver implementation is really native and not- efficient at all Theories Equality and Uninterpreted functions ✓ Linear Real Arithmetic ✓ Bit-vector (currently implementing) Linear Integer Arithmetic, Array, etc. (not yet)
  • 25. toysmt: demonstration (set-option :produce-models true) (set-logic QF_UFLRA) (declare-sort U 0) (declare-fun x () Real) (declare-fun f (U) Real) (declare-fun P (U) Bool) (declare-fun g (U) U) (declare-fun c () U) (declare-fun d () U) (assert (= (P c) (= (g c) c))) (assert (ite (P c) (> x (f d)) (< x (f d)))) (check-sat) (get-model) (exit) QF_UFLRA.smt2

  • 26. toysmt: demonstration $ toysmt QF_UFLRA.smt2
 success … sat ((define-fun P ((x!1 U)) Bool
 (ite (= x!1 (as @3 U)) true false))
 (define-fun c () U (as @3 U))
 (define-fun d () U (as @4 U))
 (define-fun f ((x!1 U)) Real
 (ite (= x!1 (as @4 U)) 0 (/ 555555 1)))
 (define-fun g ((x!1 U)) U
 (ite (= x!1 (as @3 U)) (as @3 U) (as @-1 U)))
 (define-fun x () Real (/ 1 10)))
  • 27. For those who do not read SEXP U = {@-1, @1, …, @4, …} x = 1/10 : Real c = @3 : U d = @4 : U P(x) = if x = @3 then true else false f(x) = if x = @4 then 0 else 55555 g(x) = if x = @3 then @3 else @-1
  • 28. toysmt in SMT-COMP 2016 QF_LRA (Main Track) http://smtcomp.sourceforge.net/2016/results-QF_LRA.shtml?v=1467876482 ‘toysmt’ ended up dead last.
 But without wrong results! (Thanks to QuickCheck!)
  • 29. toysmt: Future work Fill the gap with state-of-the-art solvers (even a little) There’re lots of rooms for performance improvement. More theories: Bit-vectors, Integer arithmetic, Array, … More features: e.g. Proof-generation Using ‘toysmt’ as a backend of ‘sbv'. Re-challenge in next year's SMT-COMP competition.
  • 30. Conclusion SAT solvers are amazingly fast for solving many combinatorial problems SMT is an extension of SAT to handle high-level constraints using specialized solvers. sbv is a neat Haskell library for using SMT solvers toysmt is a SMT solver written in Haskell
  • 32. Further readings Handbook of Satisfiability A. Biere, M. Heule, H. Van Maaren, and T. Walsh, Eds. IOS Press, Feb. 2009. It is a very good book covering variety of topics related to SAT/ SMT.