Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラミングシステムScarabについて

Scarab 
SAT-based Constraint Programming System in Scala 
Takehide Soh1 
worked in cooperation with 
Daniel Le Berre2 Stephanie Roussel2 
Mutsunori Banbara1 Naoyuki Tamura1 
1Information Science and Technology Center, Kobe University 
2CRIL-CNRS, UMR 8188, Universite d'Artois 
2014/09/05 
ScalaMatsuri 
1 / 60
Contents of Talk 
1 What is SAT? 
2 Scarab: SAT-based CP System in Scala 
3 Designing Constraint Models in Scarab 
4 Advanced Solving Techniques using Sat4j 
2 / 60
SAT (Boolean satis
ability testing) Problems 
SAT is a problem of deciding whether a given Boolean formula is 
satis
able or not. 
SAT was the
rst NP-complete problem [Cook, 1971] and is the most 
fundamental problem in Computer Science both theoretically and 
practically. 
SAT instances are given in the Conjunctive Normal Form (CNF). 
A CNF formula is a conjunction of clauses. 
A clause is a disjunction of literals. 
A literal is either a Boolean variable or its negation. 
3 / 60
SAT (Boolean satis
ability testing) Problems 
SAT is a problem of deciding whether a given Boolean formula is 
satis
able or not. 
SAT was the
rst NP-complete problem [Cook, 1971] and is the most 
fundamental problem in Computer Science both theoretically and 
practically. 
Example of an SAT instance (in CNF) 
Let a; b; c 2 fTrue; Falseg be Boolean variables. 
Question: the following CNF formula is satis
able or not? 
(a _ b _ c) ^ 
(:a _ :b) ^ 
(:a _ :c) ^ 
(:b _ :c) 
Answer: Yes. 
There is an assignment (a; b; c) = (True; False; False) satisfying all clauses. 
4 / 60
SAT Solvers 
There are 2n combinations for assignments. 
We cannot solve any SAT instances even for small n (e.g. n = 100)? 
Much eort on SAT solvers practically has been pushing up their 
limitation! 
SAT solver is a program of deciding whether a given SAT instance is 
satis
able (SAT) or unsatis
able (UNSAT). 
Most of all SAT solvers return a satis
able assignment when the 
instance is SAT. 
Complete SAT solvers originated in DPLL [Davis et al., 1962]. 
In particular, since around 2000, their performance is improved every 
year with techniques of Con
ict Driven Clause Learning (CDCL), 
Non-chronological Backtracking, Rapid Restarts, and Variable 
Selection Heuristics. 
Modern SAT solvers can handle instances with more than 106 
variables and 107 clauses. 
5 / 60
Progress of SAT Solvers (shown by [Simon 2011]) 
1200 
1000 
800 
Results of the SAT competition/race winners on the SAT 2009 application benchmarks, 20mn timeout 
Limmat (2002) 
Zchaff (2002) 
Berkmin (2002) 
Forklift (2003) 
Siege (2003) 
Zchaff (2004) 
SatELite (2005) 
Minisat 2 (2006) 
Picosat (2007) 
Rsat (2007) 
Minisat 2.1 (2008) 
Precosat (2009) 
Glucose (2009) 
Clasp (2009) 
Cryptominisat (2010) 
Lingeling (2010) 
Minisat 2.2 (2010) 
Glucose 2 (2011) 
Glueminisat (2011) 
Contrasat (2011) 
CPU Time (in seconds) Number of problems solved 
600 
400 
200 
0 
0 20 40 60 80 100 120 140 160 180 
Cactus Plot shown by [Simon 2011] 6 / 60
Applications of SAT Technology 
Thanks to the remarkable progress of SAT solvers, SAT-based Systems 
have been actively studied: 
Planning (SATPLAN, Blackbox) [Kautz  Selman 1992] 
Job-shop Scheduling [Crawford  Baker 1994] 
Bounded Model Checking [Biere 1999] 
Term Rewriting (AProVE) [Giesl et al. 2004] 
Constraint Satisfaction Problem (Sugar) [Tamura et al. 2006] 
Others 
Test Case Generation, 
Systems Biology, 
Timetabling, 
Packing, 
Puzzle, and more! 
7 / 60
Other News around SAT 
A SAT solver Sat4j implemented on Java has been integrated into 
Eclipse for managing plugins dependencies in their update manager. 
Donald E. Knuth gave an invited talk Satis
ability and The Art of 
Computer Programming at the International Conference on Theory 
and Applications of Satis
ability Testing 2012. 
In addition, SAT will be appeared in Volume 4b of The Art Of 
Computer Programming. 
Reference to SAT 
Biere, A., Heule, M., van Maaren, H., and Walsh, T., editors (2009). 
Handbook of Satis
ability, volume 185 of Frontiers in Arti
cial 
Intelligence and Applications (FAIA). IOS Press. 
(in Japanese) Recent Advances in SAT Techniques, Journal of the 
Japan Society for Arti
cial Intelligence, Special Issue, 25(1), 2010. 
8 / 60
Contents of Talk 
1 What is SAT? 
2 Scarab: SAT-based CP System in Scala 
3 Designing Constraint Models in Scarab 
4 Advanced Solving Techniques using Sat4j 
9 / 60
Motivation 
Modern fast SAT solvers have promoted the development of 
SAT-based systems for various problems. 
For an intended problem, we usually need to develop a dedicated 
program that encodes it into SAT. 
It sometimes bothers focusing on problem modeling which plays an 
important role in the system development process. 
In this talk 
We introduce the Scarab system, which is a prototyping tool for 
developing SAT-based systems. 
Its features are also introduced through examples of 
Graph Coloring and Pandiagonal Latin Square. 
10 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
11 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
Encoder 
API 
12 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
Encoder 
API 
800 Lines of Scala 
13 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
Scarab 
Program 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
Encoder 
API 
(DSL+Scala) 
Encoder 
14 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
CSP Encoder 
Scarab 
Program 
(DSL+Scala) 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
API 
Encoder 
15 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
Sat4j 
CSP Encoder 
MAP 
SAT 
Scarab 
Program 
(DSL+Scala) 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
API 
Encoder 
16 / 60
Scarab 
Scarab is a prototyping tool for developing SAT-based Constraint 
Programming (CP) systems. 
Its major design principle is to provide an expressive, ecient, 
customizable, and portable workbench for SAT-based system developers. 
It consists of the followings: 
1 Scarab DSL: Domain Speci
c Language for Constraint Programming 
2 API of CSP Solver 
3 SAT encoding module 
4 API of SAT solvers 
Scarab 
Program 
Sat4j 
CSP 
Scarab 
DSL 
SAT Solver 
API 
CSP Solver 
Encoder 
CSP 
Solution 
SAT 
SAT 
MAP 
Decoder Solution 
API 
(DSL+Scala) 
Encoder 
17 / 60
Other Features 
Eciency Scarab is ecient in the sense that it uses an optimized 
version of the order encoding for encoding CSP into SAT. 
Portability 
The combination of Scarab and Sat4j enables the development of 
portable applications on JVM (Java Virtual Machine). 
Customizability 
Scarab is 500 lines long without comments. It allows programmers to 
customize their own constraints. 
Availability of Advanced SAT Techniques 
Thanks to the tight integration to Sat4j, it is available to use several 
SAT techniques, e.g., incremental SAT solving. 
18 / 60
Example of Scarab Program: GCP.scala 
Graph coloring problem (GCP) is a 
problem of
nding a coloring of the 
nodes such that colors of adjacent 
nodes are dierent. 
1 
5 2 
4 
3 
1 
Input Solution 
2 
4 3 
5 
1: import jp.kobe_u.scarab.csp._ 
2: import jp.kobe_u.scarab.solver._ 
3: import jp.kobe_u.scarab.sapp._ 
4: 
5: val nodes = Seq(1,2,3,4,5) 
6: val edges = Seq((1,2),(1,5),(2,3),(2,4),(3,4),(4,5)) 
7: val colors = 3 
8: for (i - nodes) int('n(i),1,colors) 
9: for ((i,j) - edges) add('n(i) !== 'n(j)) 
10: 
11: if (find) println(solution) 
19 / 60
Imports 
import jp.kobe_u.scarab.csp._ 
import jp.kobe_u.scarab.solver._ 
import jp.kobe_u.scarab.sapp._ 
First 2 lines import classes of CSP and CSP solver. 
Third line imports the default CSP, Encoder, SAT Solver, and CSP 
Solver objects. 
It also imports DSL methods provided by Scarab. 
int(x, lb, ub) method de
nes an integer variable. 
add(c) method de
nes a constraint. 
find method searches a solution. 
solution method returns the solution. 
etc. 
20 / 60
Instance Structure 
val nodes = Seq(1,2,3,4,5) 
val edges = Seq((1,2),(1,5),(2,3),(2,4),(3,4),(4,5)) 
val colors = 3 
It de
nes the given set of nodes and edges as the sequence object in 
Scala. 
Available number of colors are de
ned as 3. 
21 / 60
De
ning CSP 
for (i - nodes) int('n(i),1,3) 
It adds an integer variable to the default CSP object by the int 
method. 
'n is a notation of symbols in Scala. 
They are automatically converted integer variable (Var) objects by an 
implicit conversion de
ned in Scarab. 
for ((i,j) - edges) add('n(i) !== 'n(j)) 
It adds constraints to the default CSP object. 
The following operators can be used to construct constraints: 
logical operator: , || 
comparison operator: ===, !==, , =, =,  
arithmetic operator: +, - 
22 / 60
Solving CSP 
if (find) println(solution) 
The find method encodes the CSP to SAT by order encoding, and 
call Sat4j to compute a solution. 
solution returns satis
able assignment of the CSP. 
23 / 60
Contents of Talk 
1 What is SAT? 
2 Scarab: SAT-based CP System in Scala 
3 Designing Constraint Models in Scarab 
4 Advanced Solving Techniques using Sat4j 
24 / 60
Designing Constraint Models in Scarab 
Pandiagonal Latin Square PLS(n) is a problem of placing dierent n 
numbers into n  n matrix such that each number is occurring exactly 
once for each row, column, diagonally down right, and diagonally up right. 
alldi Model 
One uses alldi constraint, which is one of the best known and most 
studied global constraints in constraint programming. 
The constraint alldi(a1; : : : ; an) ensures that the values assigned to 
the variable a1; : : : ; an must be pairwise distinct. 
Boolean Cardinality Model 
One uses Boolean cardinality constraint. 
25 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
26 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
alldi in each row (5 rows) 
27 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
alldi in each row (5 rows) 
28 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
alldi in each row (5 rows) 
alldi in each column (5 columns) 
29 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
alldi in each row (5 rows) 
alldi in each column (5 columns) 
30 / 60
alldi Model 
Pandiagonal Latin Square PLS(5) 
x11 x12 x13 x14 x15 
x21 x22 x23 x24 x25 
x31 x32 x33 x34 x35 
x41 x42 x43 x44 x45 
x51 x52 x53 x54 x55 
xij 2 f1; 2; 3; 4; 5g 
alldi in each row (5 rows) 
alldi in each column (5 columns) 
alldi in each pandiagonal (10 pandiagonals) 
31 / 60
1 of 60

Recommended

Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一 by
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一
Building a Unified Data Pipline in Spark / Apache Sparkを用いたBig Dataパイプラインの統一scalaconfjp
3.7K views37 slides
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介 by
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介
Introduction to Spark SQL and Catalyst / Spark SQLおよびCalalystの紹介scalaconfjp
2.5K views38 slides
The Evolution of Scala / Scala進化論 by
The Evolution of Scala / Scala進化論The Evolution of Scala / Scala進化論
The Evolution of Scala / Scala進化論scalaconfjp
5.2K views37 slides
Solid And Sustainable Development in Scala by
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
10.4K views48 slides
Scala, Akka, and Play: An Introduction on Heroku by
Scala, Akka, and Play: An Introduction on HerokuScala, Akka, and Play: An Introduction on Heroku
Scala, Akka, and Play: An Introduction on HerokuHavoc Pennington
16.8K views51 slides
Weaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo by
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoWeaving Dataflows with Silk - ScalaMatsuri 2014, Tokyo
Weaving Dataflows with Silk - ScalaMatsuri 2014, TokyoTaro L. Saito
3K views37 slides

More Related Content

What's hot

How Scala code is expressed in the JVM by
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVMKoichi Sakata
8.3K views89 slides
Scala profiling by
Scala profilingScala profiling
Scala profilingFilippo Pacifici
12.5K views36 slides
The Why and How of Scala at Twitter by
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at TwitterAlex Payne
40.6K views31 slides
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark by
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkScala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkEduardo Gonzalez
3.9K views46 slides
Scala in practice by
Scala in practiceScala in practice
Scala in practiceTomer Gabel
25.5K views41 slides
Scala Refactoring for Fun and Profit (Japanese subtitles) by
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Tomer Gabel
6.6K views16 slides

What's hot(20)

How Scala code is expressed in the JVM by Koichi Sakata
How Scala code is expressed in the JVMHow Scala code is expressed in the JVM
How Scala code is expressed in the JVM
Koichi Sakata8.3K views
The Why and How of Scala at Twitter by Alex Payne
The Why and How of Scala at TwitterThe Why and How of Scala at Twitter
The Why and How of Scala at Twitter
Alex Payne40.6K views
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark by Eduardo Gonzalez
Scala Matsuri 2016: Japanese Text Mining with Scala and SparkScala Matsuri 2016: Japanese Text Mining with Scala and Spark
Scala Matsuri 2016: Japanese Text Mining with Scala and Spark
Eduardo Gonzalez3.9K views
Scala in practice by Tomer Gabel
Scala in practiceScala in practice
Scala in practice
Tomer Gabel25.5K views
Scala Refactoring for Fun and Profit (Japanese subtitles) by Tomer Gabel
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)
Tomer Gabel6.6K views
Martin Odersky: What's next for Scala by Marakana Inc.
Martin Odersky: What's next for ScalaMartin Odersky: What's next for Scala
Martin Odersky: What's next for Scala
Marakana Inc.4.4K views
ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона... by Vyacheslav Lapin
ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона...ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона...
ITSubbotik - как скрестить ежа с ужом или подводные камни внедрения функциона...
Vyacheslav Lapin207 views
Java 7 Whats New(), Whats Next() from Oredev by Mattias Karlsson
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson2.2K views
Introduction of failsafe by Sunghyouk Bae
Introduction of failsafeIntroduction of failsafe
Introduction of failsafe
Sunghyouk Bae826 views
Akka Actor presentation by Gene Chang
Akka Actor presentationAkka Actor presentation
Akka Actor presentation
Gene Chang4.7K views
Apache Spark: The Analytics Operating System by Adarsh Pannu
Apache Spark: The Analytics Operating SystemApache Spark: The Analytics Operating System
Apache Spark: The Analytics Operating System
Adarsh Pannu1.1K views
Neo4 + Grails by stasimus
Neo4 + GrailsNeo4 + Grails
Neo4 + Grails
stasimus1.1K views
Concurrency Constructs Overview by stasimus
Concurrency Constructs OverviewConcurrency Constructs Overview
Concurrency Constructs Overview
stasimus1.6K views
Java Serialization Facts and Fallacies by Roman Elizarov
Java Serialization Facts and FallaciesJava Serialization Facts and Fallacies
Java Serialization Facts and Fallacies
Roman Elizarov5.9K views
The State of Managed Runtimes 2013, by Attila Szegedi by ZeroTurnaround
The State of Managed Runtimes 2013, by Attila SzegediThe State of Managed Runtimes 2013, by Attila Szegedi
The State of Managed Runtimes 2013, by Attila Szegedi
ZeroTurnaround2K views
Scaling software with akka by scalaconfjp
Scaling software with akkaScaling software with akka
Scaling software with akka
scalaconfjp3.8K views
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM) by jaxLondonConference
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)
Packed Objects: Fast Talking Java Meets Native Code - Steve Poole (IBM)
jaxLondonConference1.3K views
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab by CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to Scala | Big Data Hadoop Spark Tutorial | CloudxLab
CloudxLab240 views

Viewers also liked

[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫 by
[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫
[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫gree_tech
10.8K views58 slides
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング by
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
2.9K views42 slides
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう! by
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!scalaconfjp
3.2K views58 slides
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri) by
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)TIS Inc.
4.8K views25 slides
GitBucket: The perfect Github clone by Scala by
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scalatakezoe
26.7K views37 slides
sbt, past and future / sbt, 傾向と対策 by
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策scalaconfjp
4.5K views23 slides

Viewers also liked(16)

[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫 by gree_tech
[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫
[ScalaMatsuri] グリー初のscalaプロダクト!チャットサービス公開までの苦労と工夫
gree_tech10.8K views
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング by scalaconfjp
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
scalaconfjp2.9K views
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう! by scalaconfjp
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
What's a macro?: Learning by Examples / Scalaのマクロに実用例から触れてみよう!
scalaconfjp3.2K views
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri) by TIS Inc.
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
Scalable Generator: Using Scala in SIer Business (ScalaMatsuri)
TIS Inc.4.8K views
GitBucket: The perfect Github clone by Scala by takezoe
GitBucket: The perfect Github clone by ScalaGitBucket: The perfect Github clone by Scala
GitBucket: The perfect Github clone by Scala
takezoe26.7K views
sbt, past and future / sbt, 傾向と対策 by scalaconfjp
sbt, past and future / sbt, 傾向と対策sbt, past and future / sbt, 傾向と対策
sbt, past and future / sbt, 傾向と対策
scalaconfjp4.5K views
From Ruby to Scala by tod esking
From Ruby to ScalaFrom Ruby to Scala
From Ruby to Scala
tod esking7.9K views
Node.js vs Play Framework (with Japanese subtitles) by Yevgeniy Brikman
Node.js vs Play Framework (with Japanese subtitles)Node.js vs Play Framework (with Japanese subtitles)
Node.js vs Play Framework (with Japanese subtitles)
Yevgeniy Brikman42.5K views
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜 by scalaconfjp
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
芸者東京とScala〜おみせやさんから脳トレクエストまでの軌跡〜
scalaconfjp5.5K views
Scala が支える医療系ウェブサービス #jissenscala by Kazuhiro Sera
Scala が支える医療系ウェブサービス #jissenscalaScala が支える医療系ウェブサービス #jissenscala
Scala が支える医療系ウェブサービス #jissenscala
Kazuhiro Sera30.3K views
Scala@SmartNews AdFrontend を Scala で書いた話 by Keiji Muraishi
Scala@SmartNews AdFrontend を Scala で書いた話Scala@SmartNews AdFrontend を Scala で書いた話
Scala@SmartNews AdFrontend を Scala で書いた話
Keiji Muraishi12.1K views
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala by takezoe
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscalaビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
ビズリーチの新サービスをScalaで作ってみた 〜マイクロサービスの裏側 #jissenscala
takezoe26.6K views
あなたのScalaを爆速にする7つの方法 by x1 ichi
あなたのScalaを爆速にする7つの方法あなたのScalaを爆速にする7つの方法
あなたのScalaを爆速にする7つの方法
x1 ichi9.1K views
Scala - The Simple Parts, SFScala presentation by Martin Odersky
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
Martin Odersky16.5K views
Scala Warrior and type-safe front-end development with Scala.js by takezoe
Scala Warrior and type-safe front-end development with Scala.jsScala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.js
takezoe9.3K views

Similar to Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラミングシステムScarabについて

Large scale logistic regression and linear support vector machines using spark by
Large scale logistic regression and linear support vector machines using sparkLarge scale logistic regression and linear support vector machines using spark
Large scale logistic regression and linear support vector machines using sparkMila, Université de Montréal
926 views107 slides
SCA Next Part 1 - Software Defined Radio (SDR) Webcast Slides by
SCA Next Part 1 - Software Defined Radio (SDR) Webcast SlidesSCA Next Part 1 - Software Defined Radio (SDR) Webcast Slides
SCA Next Part 1 - Software Defined Radio (SDR) Webcast SlidesADLINK Technology IoT
1.7K views42 slides
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A... by
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...ESUG
1.3K views81 slides
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o... by
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...Ganesan Narayanasamy
32 views28 slides
Introduction to Apache Hivemall v0.5.0 by
Introduction to Apache Hivemall v0.5.0Introduction to Apache Hivemall v0.5.0
Introduction to Apache Hivemall v0.5.0Makoto Yui
897 views76 slides
External Aerodynamic Optimization Using ANSYS Mesh Morphing by
External Aerodynamic Optimization Using ANSYS Mesh MorphingExternal Aerodynamic Optimization Using ANSYS Mesh Morphing
External Aerodynamic Optimization Using ANSYS Mesh MorphingMarco E. Biancolini
1.8K views41 slides

Similar to Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラミングシステムScarabについて(20)

SCA Next Part 1 - Software Defined Radio (SDR) Webcast Slides by ADLINK Technology IoT
SCA Next Part 1 - Software Defined Radio (SDR) Webcast SlidesSCA Next Part 1 - Software Defined Radio (SDR) Webcast Slides
SCA Next Part 1 - Software Defined Radio (SDR) Webcast Slides
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A... by ESUG
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
ESUG1.3K views
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o... by Ganesan Narayanasamy
OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...OpenPOWER Webinar from University of Delaware  - Title :OpenMP (offloading) o...
OpenPOWER Webinar from University of Delaware - Title :OpenMP (offloading) o...
Introduction to Apache Hivemall v0.5.0 by Makoto Yui
Introduction to Apache Hivemall v0.5.0Introduction to Apache Hivemall v0.5.0
Introduction to Apache Hivemall v0.5.0
Makoto Yui897 views
External Aerodynamic Optimization Using ANSYS Mesh Morphing by Marco E. Biancolini
External Aerodynamic Optimization Using ANSYS Mesh MorphingExternal Aerodynamic Optimization Using ANSYS Mesh Morphing
External Aerodynamic Optimization Using ANSYS Mesh Morphing
Marco E. Biancolini1.8K views
Tech Days 2015: User Presentation Vermont Technical College by AdaCore
Tech Days 2015: User Presentation Vermont Technical CollegeTech Days 2015: User Presentation Vermont Technical College
Tech Days 2015: User Presentation Vermont Technical College
AdaCore381 views
Punit_Shah_resume by Punit Shah
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
Punit Shah139 views
Punit_Shah_resume by Punit Shah
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
Punit Shah151 views
Punit_Shah_resume by Punit Shah
Punit_Shah_resumePunit_Shah_resume
Punit_Shah_resume
Punit Shah148 views
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5 by Jeff Larkin
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
GTC16 - S6410 - Comparing OpenACC 2.5 and OpenMP 4.5
Jeff Larkin1.7K views
(Costless) Software Abstractions for Parallel Architectures by Joel Falcou
(Costless) Software Abstractions for Parallel Architectures(Costless) Software Abstractions for Parallel Architectures
(Costless) Software Abstractions for Parallel Architectures
Joel Falcou1.1K views
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi... by inside-BigData.com
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
Abstractions and Directives for Adapting Wavefront Algorithms to Future Archi...
inside-BigData.com495 views
Full resume dr_russell_john_childs_2013 by Russell Childs
Full resume dr_russell_john_childs_2013Full resume dr_russell_john_childs_2013
Full resume dr_russell_john_childs_2013
Russell Childs1.4K views
Grow and Shrink - Dynamically Extending the Ruby VM Stack by KeitaSugiyama1
Grow and Shrink - Dynamically Extending the Ruby VM StackGrow and Shrink - Dynamically Extending the Ruby VM Stack
Grow and Shrink - Dynamically Extending the Ruby VM Stack
KeitaSugiyama1658 views

More from scalaconfjp

脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~ by
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~scalaconfjp
112 views50 slides
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会 by
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会scalaconfjp
72 views20 slides
GraalVM Overview Compact version by
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact versionscalaconfjp
2K views70 slides
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...scalaconfjp
842 views37 slides
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視... by
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...scalaconfjp
224 views16 slides
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau by
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan GoyeauScala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeauscalaconfjp
318 views79 slides

More from scalaconfjp(20)

脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~ by scalaconfjp
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
脆弱性対策のためのClean Architecture ~脆弱性に対するレジリエンスを確保せよ~
scalaconfjp112 views
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会 by scalaconfjp
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
Alp x BizReach SaaS事業を営む2社がお互い気になることをゆるゆる聞いてみる会
scalaconfjp72 views
GraalVM Overview Compact version by scalaconfjp
GraalVM Overview Compact versionGraalVM Overview Compact version
GraalVM Overview Compact version
scalaconfjp2K views
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by... by scalaconfjp
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
Run Scala Faster with GraalVM on any Platform / GraalVMで、どこでもScalaを高速実行しよう by...
scalaconfjp842 views
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視... by scalaconfjp
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
Monitoring Reactive Architecture Like Never Before / 今までになかったリアクティブアーキテクチャの監視...
scalaconfjp224 views
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau by scalaconfjp
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan GoyeauScala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
Scala 3, what does it means for me? / Scala 3って、私にはどんな影響があるの? by Joan Goyeau
scalaconfjp318 views
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti... by scalaconfjp
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
Functional Object-Oriented Imperative Scala / 関数型オブジェクト指向命令型 Scala by Sébasti...
scalaconfjp323 views
Scala ♥ Graal by Flavio Brasil by scalaconfjp
Scala ♥ Graal by Flavio BrasilScala ♥ Graal by Flavio Brasil
Scala ♥ Graal by Flavio Brasil
scalaconfjp315 views
Introduction to GraphQL in Scala by scalaconfjp
Introduction to GraphQL in ScalaIntroduction to GraphQL in Scala
Introduction to GraphQL in Scala
scalaconfjp721 views
Safety Beyond Types by scalaconfjp
Safety Beyond TypesSafety Beyond Types
Safety Beyond Types
scalaconfjp551 views
Reactive Kafka with Akka Streams by scalaconfjp
Reactive Kafka with Akka StreamsReactive Kafka with Akka Streams
Reactive Kafka with Akka Streams
scalaconfjp681 views
Reactive microservices with play and akka by scalaconfjp
Reactive microservices with play and akkaReactive microservices with play and akka
Reactive microservices with play and akka
scalaconfjp2K views
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント by scalaconfjp
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメントScalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
Scalaに対して意識の低いエンジニアがScalaで何したかの話, by 芸者東京エンターテインメント
scalaconfjp810 views
DWANGO by ドワンゴ by scalaconfjp
DWANGO by ドワンゴDWANGO by ドワンゴ
DWANGO by ドワンゴ
scalaconfjp636 views
OCTOPARTS by M3, Inc. by scalaconfjp
OCTOPARTS by M3, Inc.OCTOPARTS by M3, Inc.
OCTOPARTS by M3, Inc.
scalaconfjp1.2K views
Try using Aeromock by Marverick, Inc. by scalaconfjp
Try using Aeromock by Marverick, Inc.Try using Aeromock by Marverick, Inc.
Try using Aeromock by Marverick, Inc.
scalaconfjp1.2K views
統計をとって高速化する
Scala開発 by CyberZ,Inc. by scalaconfjp
統計をとって高速化する
Scala開発 by CyberZ,Inc.統計をとって高速化する
Scala開発 by CyberZ,Inc.
統計をとって高速化する
Scala開発 by CyberZ,Inc.
scalaconfjp963 views
Short Introduction of Implicit Conversion by TIS, Inc. by scalaconfjp
Short Introduction of Implicit Conversion by TIS, Inc.Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.
scalaconfjp550 views
ビズリーチ x ScalaMatsuri by BIZREACH, Inc. by scalaconfjp
ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.ビズリーチ x ScalaMatsuri  by BIZREACH, Inc.
ビズリーチ x ScalaMatsuri by BIZREACH, Inc.
scalaconfjp907 views
Solid and Sustainable Development in Scala by scalaconfjp
Solid and Sustainable Development in ScalaSolid and Sustainable Development in Scala
Solid and Sustainable Development in Scala
scalaconfjp539 views

Recently uploaded

Generic or specific? Making sensible software design decisions by
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
6 views60 slides
SAP FOR TYRE INDUSTRY.pdf by
SAP FOR TYRE INDUSTRY.pdfSAP FOR TYRE INDUSTRY.pdf
SAP FOR TYRE INDUSTRY.pdfVirendra Rai, PMP
27 views3 slides
Ports-and-Adapters Architecture for Embedded HMI by
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMIBurkhard Stubert
21 views19 slides
Fleet Management Software in India by
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India Fleetable
12 views1 slide
Navigating container technology for enhanced security by Niklas Saari by
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas SaariMetosin Oy
14 views34 slides
Programming Field by
Programming FieldProgramming Field
Programming Fieldthehardtechnology
5 views9 slides

Recently uploaded(20)

Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
Ports-and-Adapters Architecture for Embedded HMI by Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable12 views
Navigating container technology for enhanced security by Niklas Saari by Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492138 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana11 views
How Workforce Management Software Empowers SMEs | TraQSuite by TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuiteHow Workforce Management Software Empowers SMEs | TraQSuite
How Workforce Management Software Empowers SMEs | TraQSuite
TraQSuite5 views
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino6 views
predicting-m3-devopsconMunich-2023-v2.pptx by Tier1 app
predicting-m3-devopsconMunich-2023-v2.pptxpredicting-m3-devopsconMunich-2023-v2.pptx
predicting-m3-devopsconMunich-2023-v2.pptx
Tier1 app8 views
predicting-m3-devopsconMunich-2023.pptx by Tier1 app
predicting-m3-devopsconMunich-2023.pptxpredicting-m3-devopsconMunich-2023.pptx
predicting-m3-devopsconMunich-2023.pptx
Tier1 app7 views
FOSSLight Community Day 2023-11-30 by Shane Coughlan
FOSSLight Community Day 2023-11-30FOSSLight Community Day 2023-11-30
FOSSLight Community Day 2023-11-30
Shane Coughlan5 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller42 views

Scarab: SAT-based Constraint Programming System in Scala / Scala上で実現された制約プログラミングシステムScarabについて

  • 1. Scarab SAT-based Constraint Programming System in Scala Takehide Soh1 worked in cooperation with Daniel Le Berre2 Stephanie Roussel2 Mutsunori Banbara1 Naoyuki Tamura1 1Information Science and Technology Center, Kobe University 2CRIL-CNRS, UMR 8188, Universite d'Artois 2014/09/05 ScalaMatsuri 1 / 60
  • 2. Contents of Talk 1 What is SAT? 2 Scarab: SAT-based CP System in Scala 3 Designing Constraint Models in Scarab 4 Advanced Solving Techniques using Sat4j 2 / 60
  • 4. ability testing) Problems SAT is a problem of deciding whether a given Boolean formula is satis
  • 5. able or not. SAT was the
  • 6. rst NP-complete problem [Cook, 1971] and is the most fundamental problem in Computer Science both theoretically and practically. SAT instances are given in the Conjunctive Normal Form (CNF). A CNF formula is a conjunction of clauses. A clause is a disjunction of literals. A literal is either a Boolean variable or its negation. 3 / 60
  • 8. ability testing) Problems SAT is a problem of deciding whether a given Boolean formula is satis
  • 9. able or not. SAT was the
  • 10. rst NP-complete problem [Cook, 1971] and is the most fundamental problem in Computer Science both theoretically and practically. Example of an SAT instance (in CNF) Let a; b; c 2 fTrue; Falseg be Boolean variables. Question: the following CNF formula is satis
  • 11. able or not? (a _ b _ c) ^ (:a _ :b) ^ (:a _ :c) ^ (:b _ :c) Answer: Yes. There is an assignment (a; b; c) = (True; False; False) satisfying all clauses. 4 / 60
  • 12. SAT Solvers There are 2n combinations for assignments. We cannot solve any SAT instances even for small n (e.g. n = 100)? Much eort on SAT solvers practically has been pushing up their limitation! SAT solver is a program of deciding whether a given SAT instance is satis
  • 13. able (SAT) or unsatis
  • 14. able (UNSAT). Most of all SAT solvers return a satis
  • 15. able assignment when the instance is SAT. Complete SAT solvers originated in DPLL [Davis et al., 1962]. In particular, since around 2000, their performance is improved every year with techniques of Con ict Driven Clause Learning (CDCL), Non-chronological Backtracking, Rapid Restarts, and Variable Selection Heuristics. Modern SAT solvers can handle instances with more than 106 variables and 107 clauses. 5 / 60
  • 16. Progress of SAT Solvers (shown by [Simon 2011]) 1200 1000 800 Results of the SAT competition/race winners on the SAT 2009 application benchmarks, 20mn timeout Limmat (2002) Zchaff (2002) Berkmin (2002) Forklift (2003) Siege (2003) Zchaff (2004) SatELite (2005) Minisat 2 (2006) Picosat (2007) Rsat (2007) Minisat 2.1 (2008) Precosat (2009) Glucose (2009) Clasp (2009) Cryptominisat (2010) Lingeling (2010) Minisat 2.2 (2010) Glucose 2 (2011) Glueminisat (2011) Contrasat (2011) CPU Time (in seconds) Number of problems solved 600 400 200 0 0 20 40 60 80 100 120 140 160 180 Cactus Plot shown by [Simon 2011] 6 / 60
  • 17. Applications of SAT Technology Thanks to the remarkable progress of SAT solvers, SAT-based Systems have been actively studied: Planning (SATPLAN, Blackbox) [Kautz Selman 1992] Job-shop Scheduling [Crawford Baker 1994] Bounded Model Checking [Biere 1999] Term Rewriting (AProVE) [Giesl et al. 2004] Constraint Satisfaction Problem (Sugar) [Tamura et al. 2006] Others Test Case Generation, Systems Biology, Timetabling, Packing, Puzzle, and more! 7 / 60
  • 18. Other News around SAT A SAT solver Sat4j implemented on Java has been integrated into Eclipse for managing plugins dependencies in their update manager. Donald E. Knuth gave an invited talk Satis
  • 19. ability and The Art of Computer Programming at the International Conference on Theory and Applications of Satis
  • 20. ability Testing 2012. In addition, SAT will be appeared in Volume 4b of The Art Of Computer Programming. Reference to SAT Biere, A., Heule, M., van Maaren, H., and Walsh, T., editors (2009). Handbook of Satis
  • 21. ability, volume 185 of Frontiers in Arti
  • 22. cial Intelligence and Applications (FAIA). IOS Press. (in Japanese) Recent Advances in SAT Techniques, Journal of the Japan Society for Arti
  • 23. cial Intelligence, Special Issue, 25(1), 2010. 8 / 60
  • 24. Contents of Talk 1 What is SAT? 2 Scarab: SAT-based CP System in Scala 3 Designing Constraint Models in Scarab 4 Advanced Solving Techniques using Sat4j 9 / 60
  • 25. Motivation Modern fast SAT solvers have promoted the development of SAT-based systems for various problems. For an intended problem, we usually need to develop a dedicated program that encodes it into SAT. It sometimes bothers focusing on problem modeling which plays an important role in the system development process. In this talk We introduce the Scarab system, which is a prototyping tool for developing SAT-based systems. Its features are also introduced through examples of Graph Coloring and Pandiagonal Latin Square. 10 / 60
  • 26. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. 11 / 60
  • 27. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 28. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers Scarab DSL SAT Solver API CSP Solver Encoder API 12 / 60
  • 29. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 30. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers Scarab DSL SAT Solver API CSP Solver Encoder API 800 Lines of Scala 13 / 60
  • 31. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 32. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers Scarab Program Scarab DSL SAT Solver API CSP Solver Encoder API (DSL+Scala) Encoder 14 / 60
  • 33. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 34. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers CSP Encoder Scarab Program (DSL+Scala) Scarab DSL SAT Solver API CSP Solver API Encoder 15 / 60
  • 35. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 36. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers Sat4j CSP Encoder MAP SAT Scarab Program (DSL+Scala) Scarab DSL SAT Solver API CSP Solver API Encoder 16 / 60
  • 37. Scarab Scarab is a prototyping tool for developing SAT-based Constraint Programming (CP) systems. Its major design principle is to provide an expressive, ecient, customizable, and portable workbench for SAT-based system developers. It consists of the followings: 1 Scarab DSL: Domain Speci
  • 38. c Language for Constraint Programming 2 API of CSP Solver 3 SAT encoding module 4 API of SAT solvers Scarab Program Sat4j CSP Scarab DSL SAT Solver API CSP Solver Encoder CSP Solution SAT SAT MAP Decoder Solution API (DSL+Scala) Encoder 17 / 60
  • 39. Other Features Eciency Scarab is ecient in the sense that it uses an optimized version of the order encoding for encoding CSP into SAT. Portability The combination of Scarab and Sat4j enables the development of portable applications on JVM (Java Virtual Machine). Customizability Scarab is 500 lines long without comments. It allows programmers to customize their own constraints. Availability of Advanced SAT Techniques Thanks to the tight integration to Sat4j, it is available to use several SAT techniques, e.g., incremental SAT solving. 18 / 60
  • 40. Example of Scarab Program: GCP.scala Graph coloring problem (GCP) is a problem of
  • 41. nding a coloring of the nodes such that colors of adjacent nodes are dierent. 1 5 2 4 3 1 Input Solution 2 4 3 5 1: import jp.kobe_u.scarab.csp._ 2: import jp.kobe_u.scarab.solver._ 3: import jp.kobe_u.scarab.sapp._ 4: 5: val nodes = Seq(1,2,3,4,5) 6: val edges = Seq((1,2),(1,5),(2,3),(2,4),(3,4),(4,5)) 7: val colors = 3 8: for (i - nodes) int('n(i),1,colors) 9: for ((i,j) - edges) add('n(i) !== 'n(j)) 10: 11: if (find) println(solution) 19 / 60
  • 42. Imports import jp.kobe_u.scarab.csp._ import jp.kobe_u.scarab.solver._ import jp.kobe_u.scarab.sapp._ First 2 lines import classes of CSP and CSP solver. Third line imports the default CSP, Encoder, SAT Solver, and CSP Solver objects. It also imports DSL methods provided by Scarab. int(x, lb, ub) method de
  • 43. nes an integer variable. add(c) method de
  • 44. nes a constraint. find method searches a solution. solution method returns the solution. etc. 20 / 60
  • 45. Instance Structure val nodes = Seq(1,2,3,4,5) val edges = Seq((1,2),(1,5),(2,3),(2,4),(3,4),(4,5)) val colors = 3 It de
  • 46. nes the given set of nodes and edges as the sequence object in Scala. Available number of colors are de
  • 47. ned as 3. 21 / 60
  • 48. De
  • 49. ning CSP for (i - nodes) int('n(i),1,3) It adds an integer variable to the default CSP object by the int method. 'n is a notation of symbols in Scala. They are automatically converted integer variable (Var) objects by an implicit conversion de
  • 50. ned in Scarab. for ((i,j) - edges) add('n(i) !== 'n(j)) It adds constraints to the default CSP object. The following operators can be used to construct constraints: logical operator: , || comparison operator: ===, !==, , =, =, arithmetic operator: +, - 22 / 60
  • 51. Solving CSP if (find) println(solution) The find method encodes the CSP to SAT by order encoding, and call Sat4j to compute a solution. solution returns satis
  • 52. able assignment of the CSP. 23 / 60
  • 53. Contents of Talk 1 What is SAT? 2 Scarab: SAT-based CP System in Scala 3 Designing Constraint Models in Scarab 4 Advanced Solving Techniques using Sat4j 24 / 60
  • 54. Designing Constraint Models in Scarab Pandiagonal Latin Square PLS(n) is a problem of placing dierent n numbers into n n matrix such that each number is occurring exactly once for each row, column, diagonally down right, and diagonally up right. alldi Model One uses alldi constraint, which is one of the best known and most studied global constraints in constraint programming. The constraint alldi(a1; : : : ; an) ensures that the values assigned to the variable a1; : : : ; an must be pairwise distinct. Boolean Cardinality Model One uses Boolean cardinality constraint. 25 / 60
  • 55. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g 26 / 60
  • 56. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) 27 / 60
  • 57. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) 28 / 60
  • 58. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) 29 / 60
  • 59. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) 30 / 60
  • 60. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) alldi in each pandiagonal (10 pandiagonals) 31 / 60
  • 61. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) alldi in each pandiagonal (10 pandiagonals) 32 / 60
  • 62. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) alldi in each pandiagonal (10 pandiagonals) 33 / 60
  • 63. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) alldi in each pandiagonal (10 pandiagonals) 34 / 60
  • 64. alldi Model Pandiagonal Latin Square PLS(5) x11 x12 x13 x14 x15 x21 x22 x23 x24 x25 x31 x32 x33 x34 x35 x41 x42 x43 x44 x45 x51 x52 x53 x54 x55 1 2 3 4 5 3 4 5 1 2 5 1 2 3 4 2 3 4 5 1 4 5 1 2 3 xij 2 f1; 2; 3; 4; 5g alldi in each row (5 rows) alldi in each column (5 columns) alldi in each pandiagonal (10 pandiagonals) PLS(5) is satis
  • 66. Scarab Program for alldi Model 1: import jp.kobe_u.scarab.csp._ 2: import jp.kobe_u.scarab.solver._ 3: import jp.kobe_u.scarab.sapp._ 4: 5: val n = args(0).toInt 6: 7: for (i - 1 to n; j - 1 to n) int('x(i,j),1,n) 8: for (i - 1 to n) f 9: add(alldiff((1 to n).map(j = 'x(i,j)))) 10: add(alldiff((1 to n).map(j = 'x(j,i)))) 11: add(alldiff((1 to n).map(j = 'x(j,(i+j-1)%n+1)))) 12: add(alldiff((1 to n).map(j = 'x(j,(i+(j-1)*(n-1))%n+1)))) 13: g 14: 15: if (find) println(solution) 36 / 60
  • 67. Encoding alldi In Scarab, all we have to do for implementing global constraints is just decomposing them into simple arithmetic constraints [Bessiere et al. `09]. In the case of alldi(a1; : : : ; an), It is decomposed into pairwise not-equal constraints ^ 1ijn (ai6= aj ) . This (naive) alldi is enough to just have a feasible constraint model for PLS(n). But, one probably want to improve this :) 37 / 60
  • 68. Extra Constraints for alldi (a1; : : : ; an) In Pandiagonal Latin Square PLS(n), all integer variables a1; : : : ; an have the same domain f1; : : : ; ng. Then, we can add the following extra constraints. Permutation constraints: ^n i=1 _n j=1 (aj = i ) It represents that one of a1; : : : ; an must be assigned to i . Pigeon hole constraint: : ^n i=1 (ai n) ^ : ^n i=1 (ai 1) It represents that mutually dierent n variables cannot be assigned within the interval of the size n 1. 38 / 60
  • 69. alldi (naive) def alldiff(xs: Seq[Var]) = And(for (Seq(x, y) - xs.combinations(2)) yield x !== y) 39 / 60
  • 70. alldi (optimized) def alldiff(xs: Seq[Var]) = f val lb = for (x - xs) yield csp.dom(x).lb val ub = for (x - xs) yield csp.dom(x).ub == pigeon hole val ph = And(Or(for (x - xs) yield !(x lb.min+xs.size-1)), Or(for (x - xs) yield !(x ub.max-xs.size+1))) == permutation def perm = And(for (num - lb.min to ub.max) yield Or(for (x - xs) yield x === num)) val extra = if (ub.max-lb.min+1 == xs.size) And(ph,perm) else ph And(And(for (Seq(x, y) - xs.combinations(2)) yield x !== y),extra) g 40 / 60
  • 71. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) 41 / 60
  • 72. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 42 / 60
  • 73. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 43 / 60
  • 74. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 44 / 60
  • 75. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 45 / 60
  • 76. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 for each pandiagonal (10 pandiagonals) y11k + y22k + y33k + y44k + y55k = 1 46 / 60
  • 77. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 for each pandiagonal (10 pandiagonals) y11k + y22k + y33k + y44k + y55k = 1 47 / 60
  • 78. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 for each pandiagonal (10 pandiagonals) y11k + y22k + y33k + y44k + y55k = 1 48 / 60
  • 79. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 for each pandiagonal (10 pandiagonals) y11k + y22k + y33k + y44k + y55k = 1 49 / 60
  • 80. Boolean Cardinality Model y11k y12k y13k y14k y15k y21k y22k y23k y24k y25k y31k y32k y33k y34k y35k y41k y42k y43k y44k y45k y51k y52k y53k y54k y55k wgh0 wgh/ wgh2 wgh1 wgh3 yijk 2 f0; 1g yijk = 1 , k is placed at (i ; j) for each value (5 values) for each row (5 rows) yi1k + yi2k + yi3k + yi4k + yi5k = 1 for each column (5 columns) y1jk + y2jk + y3jk + y4jk + y5jk = 1 for each pandiagonal (10 pandiagonals) y11k + y22k + y33k + y44k + y55k = 1 for each (i ; j) position (25 positions) yij1 + yij2 + yij3 + yij4 + yij5 = 1 50 / 60
  • 81. Scarab Program for Boolean Cardinality Model 1: import jp.kobe_u.scarab.csp._ 2: import jp.kobe_u.scarab.solver._ 3: import jp.kobe_u.scarab.sapp._ 4: 5: for (i - 1 to n; j - 1 to n; num - 1 to n) 6: int('y(i,j,num),0,1) 7: 8: for (num - 1 to n) f 9: for (i - 1 to n) f 10: add(BC((1 to n).map(j = 'y(i,j,num)))===1) 11: add(BC((1 to n).map(j = 'y(j,i,num)))===1) 12: add(BC((1 to n).map(j = 'y(j,(i+j-1)%n+1,num))) === 1) 13: add(BC((1 to n).map(j = 'y(j,(i+(j-1)*(n-1))%n+1,num))) === 1) 14: g 15: g 16: 17: for (i - 1 to n; j - 1 to n) 18: add(BC((1 to n).map(k = 'y(i,j,k))) === 1) 19: 20: if (find) println(solution) 51 / 60
  • 82. SAT Encoding of Boolean Cardinality in Scarab There are several ways for encoding Boolean cardinality. In Scarab, we can easily write the following encoding methods by de
  • 83. ning your own BC methods. Pairwise Totalizer [Bailleux `03] Sequential Counter [Sinz `05] In total, 3 variants of Boolean cardinality model are obtained. BC1: Pairwise (implemented by 2 lines) BC2: Totalizer [Bailleux `03] (implemented by 15 lines) BC3: Sequential Counter [Sinz `05] (implemented by 7 lines) Good point to use Scarab is that we can test those models without writing dedicated programs. 52 / 60
  • 84. Experiments Comparison on Solving Pandiagonal Latin Square To show the dierences in performance, we compared the following 5 models. 1 AD1: naive alldi 2 AD2: optimized alldi 3 BC1: Pairwise 4 BC2: [Bailleux `03] 5 BC3: [Sinz `05] Benchmark and Experimental Environment Benchmark: Pandiagonal Latin Square (n = 7 to n = 16) CPU: 2.93GHz, Mem: 2GB, Time Limit: 3600 seconds 53 / 60
  • 85. Results (CPU Time in Seconds) n SAT/UNSAT AD1 AD2 BC1 BC2 BC3 7 SAT 0.2 0.2 0.2 0.3 0.3 8 UNSAT T.O. 0.5 0.3 0.3 0.3 9 UNSAT T.O. 0.3 0.5 0.3 0.2 10 UNSAT T.O. 0.4 1.0 0.3 0.3 11 SAT 0.3 0.3 2.3 0.5 0.4 12 UNSAT T.O. 1.0 5.3 0.8 0.8 13 SAT T.O. 0.5 T.O. T.O. T.O. 14 UNSAT T.O. 9.7 32.4 8.2 6.8 15 UNSAT T.O. 388.9 322.7 194.6 155.8 16 UNSAT T.O. 457.1 546.6 300.7 414.8 Only optimized version of alldi model (AD2) solved all instances. Modeling and encoding have an important role in developing SAT-based systems. Scarab helps users to focus on them ;) 54 / 60
  • 86. Contents of Talk 1 What is SAT? 2 Scarab: SAT-based CP System in Scala 3 Designing Constraint Models in Scarab 4 Advanced Solving Techniques using Sat4j 55 / 60
  • 87. Advanced Solving Techniques using Sat4j Thanks to the tight integration to Sat4j, Scarab provides the functions: Incremental solving and CSP solving with assumptions. We explain it using the following program. 1: int('x, 1, 3) 2: int('y, 1, 3) 3: add('x === 'y) 4: find // first call of find 5: add('x !== 3) 6: find // second call of find 7: 8: find('y === 3) // with assumption y = 3 9: find('x === 1) // with assumption x = 1 56 / 60
  • 88. Incremental SAT Solving int('x, 1, 3) int('y, 1, 3) add('x === 'y) find // first call of find add('x !== 3) find // second call of find In the
  • 89. rst call of find method, the whole CSP is encoded and generated SAT clauses are added to Sat4j, then it computes a solution. In the second call of find method, only the extra constraint x6= 3 is encoded and added to Sat4j, then it computes a solution. The learned clauses obtained by the
  • 90. rst find are kept at the second call. 57 / 60
  • 91. CSP Solving under Assumption find('y === 3) // with assumption y = 3 find('x === 1) // with assumption x = 1 find(assumption: Constraint) method provides CSP solving under assumption given by the speci
  • 92. ed constraint. The constraint of assumption should be encoded to a conjunction of literals (otherwise an exception is raised). Then, the literals are passed to Sat4j, then it computes a solution under assumption. We can utilize those techniques for optimization and enumeration problems. 58 / 60
  • 93. Conclusion Introducing Architecture and Features of Scarab Using Scarab, we can write various constraint models without developing dedicated encoders, which allows us to focus on problem modeling and encoding. Future Work Introducing more features from Sat4j Sat4j has various functions of
  • 94. nding MUS, optimization, solution enumeration, handling natively cardinality and pseudo-Boolean constraints. URL of Scarab http://kix.istc.kobe-u.ac.jp/~soh/scarab/ 59 / 60
  • 95. References I Biere, A., Heule, M., van Maaren, H., and Walsh, T., editors (2009). Handbook of Satis
  • 96. ability, volume 185 of Frontiers in Arti
  • 97. cial Intelligence and Applications (FAIA). IOS Press. Cook, S. A. (1971). The complexity of theorem-proving procedures. In Proceedings of the 3rd Annual ACM Symposium on Theory of Computing (STOC 1971), pages 151{158. Davis, M., Logemann, G., and Loveland, D. W. (1962). A machine program for theorem-proving. Communications of the ACM, 5(7):394{397. 60 / 60