SlideShare a Scribd company logo
1 of 14
Download to read offline
Model-counting Approaches For Nonlinear
Numerical Constraints
Mateus Borges1
, Sang Phan2
, Antonio Filieri1
, Corina P˘as˘areanu2,3
1Imperial College London, UK
2Carnegie Mellon University Silicon Valley, USA
3NASA Ames Research Center, USA
NASA Formal Methods Symposium
May 16, 2017
1 / 14
Model Counting
Applications of model counting
probabilistic inference
reliability analysis
quantitative information flow (for side-channel analysis)
. . .
Integrated Symbolic Execution for Space-Time Analysis of Code.
http://www.cmu.edu/silicon-valley/research/isstac
2 / 14
Side channels
H
L
“main” channelprogram
(unintended) side channel
main channel
output of the program, i.e. return value
side channels
execution time
power consumption
number of packets transmitted over a network
number of bytes written to a file
. . .
3 / 14
Symbolic Execution and Symbolic PathFinder
1 int x,y;
2 if(x > y){
3 x = x + y;
4 y = x − y;
5 x = x − y;
6 if(x − y > 0)
7 assert(false);
8 }
{x → X, y → Y }
PC : True
{x → X, y → Y }
PC : X > Y
{x → X + Y, y → Y }
PC : X > Y
{x → X + Y, y → X}
PC : X > Y
{x → Y, y → X}
PC : X > Y
{x → Y, y → X}
PC : X > Y ∧ Y − X > 0
6
{x → Y, y → X}
PC : X > Y ∧ Y − X ≤ 0
6
5
4
3
2
{x → X, y → Y }
PC : X ≤ Y
2
Symbolic PathFinder: symbolic JVM for Java bytecode
4 / 14
Side-channel analysis
Quantifying information leaks
Perform symbolic execution to collect all symbolic paths πi .
Compute the observable of each symbolic path oi = cost(πi ).
Compute the leakage using Shannon entropy
Leakage =
i=1...n
p(oi ) log2
1
p(oi )
Assume the secret h has uniform distribution over the domain ΩH
p(oi ) =
cost(πj )=oi
(πj )
|ΩH|
where (πj ) is computed by using model counting tools.
5 / 14
Motivation
Most previous work limit on programs with linear numerical
constraints (using Latte or barvinok).
Reliability Analysis in SymbolicPathfinder. ICSE’13.
Multi-run Side-Channel Analysis Using Symbolic Execution and
Max-SMT. CSF’16.
String Analysis for Side Channels with Segmented Oracles. FSE’16.
Synthesis of Adaptive Side-Channel Attacks. CSF’17.
⇒ Model counting of path conditions for programs with nonlinear
numerical constraints.
6 / 14
Taxonomy of model counting
Precision
Exact counting
Approximate counting
Level
Bit-level counting
Word-level counting
Others:
Blocking-clause enumeration
BDD-based enumerations
Counting with Gr¨obner bases
Brute force
7 / 14
Evaluation setup
Tool selection
Publicly available implementations of model counting
algorithms
POC’s developed by us
Fixed execution time (1 hour)
Benchmark: Modular exponentiation
Two distinct implementations
Extracted path conditions through symbolic execution
8 / 14
Evaluated Tools
Precision Level
All-SAT exact bit
Dsharp exact bit
SharpCDCL exact bit
SharpSAT exact bit
ApproxMC approximate bit
SMTapproxMC approximate word
Brute force exact word
MathSAT exact word
Z3 (blocking clause) exact word
9 / 14
Modular Exponentiation
Asymmetric cryptographic algorithms
public key: (e,n)
private key: d
message: m
encryption: c = modPow(m, e, n)
decryption: m = modPow(c, d, n)
Experiments with
n = 1717
n = 834443
n = 1964903306
(product of two distinct prime numbers)
modPow(x, y, z) = xy
mod z
int modPow1(int c, int d, int n){
int s = 1, y = c, res=0;
while (d > 0) {
if (d % 2 == 1) {
//reduction:
int tmp = s ∗ y;
if (tmp > n){
tmp = tmp − n;
}
res = tmp % n;
} else {
res=s;
}
s = (res ∗ res) % n;
d /= 2;
}
return res;
}
10 / 14
Modular Exponentiation
SnapBuddy
A photo-sharing web application.
Given by DARPA as one of the engagement problems.
public static BigInteger modPow2(final BigInteger x, final BigInteger y,
final BigInteger z) {
BigInteger s = BigInteger.valueOf(1L);
for (int width = y.bitLength(), i = 0; i < width; ++i) {
s = s.multiply(s).mod(z);
if (y.testBit(width − i − 1)) {
s = fastMultiply(s, x).mod(z);
}
}
return s;
}
}
11 / 14
Symbolic Execution of Modular Exponentiation
modPow(x, y, z) = xy mod z
Perform symbolic execution on
modPow1
Both x and y are symbolic.
z is either 1717, 834443, or 1964903306.
modPow2
x is a concrete 1532-bit value.
y is symbolic BigInteger with 40 bits.
z is a concrete 1536-bit value (hard-coded in SnapBuddy)
12 / 14
Experimental Results
Subject a-1 a-2 a-3 a-4 a-5 a-6 a-7 b-1 b-2 b-3 b-4
N. Ops 11 26 15 37 121 57 117 250 243 1428 1428
Domain Size 10K 10K 10K 25M 25M 59B 59B 4T 4T 32B 32B
N. Solutions 1.7K 7 1.7K 208K 109K 80M 77M 2B 66B 1 1
N. CNF clauses 40K 78K 58K 67K 114K 58K 78K 2K 2K 2K 2K
Execution time
BitBlasting 15s 30s 24s 25s 44s 23s 30s 1s 1s 1s 2s
SharpCDCL 1s 1s 1s 43m - - - - - 1s 1s
All-SAT 1s 8s 2s 31m∗
59m∗
15m∗
19m∗
- - 1s 1s
SharpSAT 5s 2s 11s 29m 53m - - 1s 1s 1s 1s
Dsharp 12m 32s 22m - - - - 1s 1s 1s 1s
ApproxMC (f) 4s 2s 5s 16s 32s 1m 1m 4s 5s 1s 1s
ApproxMC (p) 4s 2s 6s 2m 5m 21m 24m 16s 25s 1s 1s
SMTapproxMC (f) 6m 15m 8m - - - - - - 2m 2m
SMTapproxMC (p) - 15m - - - - - - - 2m 2m
MathSAT 2s 2s 5s 38m 54m - - - - 1s 1s
Z3-BC 12s 3s 18s - - - - - - 1s 1s
Brute Force 1s 1s 1s 1s 1s 8m 8m - - 2m 2m
13 / 14
Conclusion
Small domain: brute force!
Exact counters can be effective when the problem is small
(< 50K clauses) or count is close to domain size.
Most promising: approximate model counting with bit-level
hashing.
Performance can degrade when increased precision is required.
14 / 14

More Related Content

What's hot

Tpr star tree
Tpr star treeTpr star tree
Tpr star treeWin Yu
 
Using R in remote computer clusters
Using R in remote computer clustersUsing R in remote computer clusters
Using R in remote computer clustersBurak Himmetoglu
 
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001Casiano Rodriguez-leon
 
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001Casiano Rodriguez-leon
 
09 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-109 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-1Jannat41
 
Semet Gecco06
Semet Gecco06Semet Gecco06
Semet Gecco06ysemet
 
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...Provectus
 
Ecet 330 final exam new 2016
Ecet 330 final exam new 2016Ecet 330 final exam new 2016
Ecet 330 final exam new 2016Olly_March
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06Niit Care
 
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...Artjom Simon
 
Compiler presention
Compiler presentionCompiler presention
Compiler presentionFaria Priya
 
Ecet 330 final exam new 2016
Ecet 330 final exam new 2016Ecet 330 final exam new 2016
Ecet 330 final exam new 2016sergejsvolkovs10
 

What's hot (18)

Tpr star tree
Tpr star treeTpr star tree
Tpr star tree
 
Using R in remote computer clusters
Using R in remote computer clustersUsing R in remote computer clusters
Using R in remote computer clusters
 
Demodulate bpsk up
Demodulate bpsk upDemodulate bpsk up
Demodulate bpsk up
 
Cs 64
Cs 64Cs 64
Cs 64
 
Matlab bode diagram_instructions
Matlab bode diagram_instructionsMatlab bode diagram_instructions
Matlab bode diagram_instructions
 
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
 
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
PREDICTING THE TIME OF OBLIVIOUS PROGRAMS. Euromicro 2001
 
09 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-109 bsc-17 dsp lab 10-1
09 bsc-17 dsp lab 10-1
 
A Polynomial-Space Exact Algorithm for TSP in Degree-5 Graphs
A Polynomial-Space Exact Algorithm for TSP in Degree-5 GraphsA Polynomial-Space Exact Algorithm for TSP in Degree-5 Graphs
A Polynomial-Space Exact Algorithm for TSP in Degree-5 Graphs
 
Semet Gecco06
Semet Gecco06Semet Gecco06
Semet Gecco06
 
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
Федор Поляков (Looksery) “Face Tracking на мобильных устройствах в режиме реа...
 
Exploring Petri Net State Spaces
Exploring Petri Net State SpacesExploring Petri Net State Spaces
Exploring Petri Net State Spaces
 
Ecet 330 final exam new 2016
Ecet 330 final exam new 2016Ecet 330 final exam new 2016
Ecet 330 final exam new 2016
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06
 
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
Scalability comparison: Traditional fork-join-based parallelism vs. Goroutine...
 
workspace_analysis
workspace_analysisworkspace_analysis
workspace_analysis
 
Compiler presention
Compiler presentionCompiler presention
Compiler presention
 
Ecet 330 final exam new 2016
Ecet 330 final exam new 2016Ecet 330 final exam new 2016
Ecet 330 final exam new 2016
 

Similar to Model-counting Approaches For Nonlinear Numerical Constraints

Big Data and Small Devices by Katharina Morik
Big Data and Small Devices by Katharina MorikBig Data and Small Devices by Katharina Morik
Big Data and Small Devices by Katharina MorikBigMine
 
Deep Learning Tomography
Deep Learning TomographyDeep Learning Tomography
Deep Learning TomographyAmir Adler
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxParthDoshi66
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfParthDoshi66
 
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...Antonio Mora
 
One Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical ComputationOne Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical ComputationWork-Bench
 
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...AIRCC Publishing Corporation
 
Improving initial generations in pso algorithm for transportation network des...
Improving initial generations in pso algorithm for transportation network des...Improving initial generations in pso algorithm for transportation network des...
Improving initial generations in pso algorithm for transportation network des...ijcsit
 
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET)
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET) PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET)
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET) Limon Prince
 
Real Time System Identification of Speech Signal Using Tms320c6713
Real Time System Identification of Speech Signal Using Tms320c6713Real Time System Identification of Speech Signal Using Tms320c6713
Real Time System Identification of Speech Signal Using Tms320c6713IOSRJVSP
 
Surrey dl-4
Surrey dl-4Surrey dl-4
Surrey dl-4ozzie73
 
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesEfficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesVissarion Fisikopoulos
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014PyData
 
"An adaptive modular approach to the mining of sensor network ...
"An adaptive modular approach to the mining of sensor network ..."An adaptive modular approach to the mining of sensor network ...
"An adaptive modular approach to the mining of sensor network ...butest
 
A Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB SimulinkA Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB SimulinkJaewook. Kang
 
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...A game theoretic approach for runtime capacity allocation in map-reduce (WACC...
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...EUBra BIGSEA
 
Medical Image Segmentation Using Hidden Markov Random Field A Distributed Ap...
Medical Image Segmentation Using Hidden Markov Random Field  A Distributed Ap...Medical Image Segmentation Using Hidden Markov Random Field  A Distributed Ap...
Medical Image Segmentation Using Hidden Markov Random Field A Distributed Ap...EL-Hachemi Guerrout
 

Similar to Model-counting Approaches For Nonlinear Numerical Constraints (20)

Big Data and Small Devices by Katharina Morik
Big Data and Small Devices by Katharina MorikBig Data and Small Devices by Katharina Morik
Big Data and Small Devices by Katharina Morik
 
Deep Learning Tomography
Deep Learning TomographyDeep Learning Tomography
Deep Learning Tomography
 
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docxDSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition[1].docx
 
xldb-2015
xldb-2015xldb-2015
xldb-2015
 
DSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdfDSP_Lab_MAnual_-_Final_Edition.pdf
DSP_Lab_MAnual_-_Final_Edition.pdf
 
All projects
All projectsAll projects
All projects
 
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...
Adaptive Ant Colony Optimization for Service Function Chaining in a Dynamic 5...
 
One Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical ComputationOne Algorithm to Rule Them All: How to Automate Statistical Computation
One Algorithm to Rule Them All: How to Automate Statistical Computation
 
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...
Automated Information Retrieval Model Using FP Growth Based Fuzzy Particle Sw...
 
Improving initial generations in pso algorithm for transportation network des...
Improving initial generations in pso algorithm for transportation network des...Improving initial generations in pso algorithm for transportation network des...
Improving initial generations in pso algorithm for transportation network des...
 
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET)
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET) PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET)
PERFORMANCE VEHICULAR AD-HOC NETWORK (VANET)
 
Real Time System Identification of Speech Signal Using Tms320c6713
Real Time System Identification of Speech Signal Using Tms320c6713Real Time System Identification of Speech Signal Using Tms320c6713
Real Time System Identification of Speech Signal Using Tms320c6713
 
Surrey dl-4
Surrey dl-4Surrey dl-4
Surrey dl-4
 
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesEfficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
 
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
Pythran: Static compiler for high performance by Mehdi Amini PyData SV 2014
 
"An adaptive modular approach to the mining of sensor network ...
"An adaptive modular approach to the mining of sensor network ..."An adaptive modular approach to the mining of sensor network ...
"An adaptive modular approach to the mining of sensor network ...
 
Ma5156
Ma5156Ma5156
Ma5156
 
A Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB SimulinkA Simple Communication System Design Lab #4 with MATLAB Simulink
A Simple Communication System Design Lab #4 with MATLAB Simulink
 
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...A game theoretic approach for runtime capacity allocation in map-reduce (WACC...
A game theoretic approach for runtime capacity allocation in map-reduce (WACC...
 
Medical Image Segmentation Using Hidden Markov Random Field A Distributed Ap...
Medical Image Segmentation Using Hidden Markov Random Field  A Distributed Ap...Medical Image Segmentation Using Hidden Markov Random Field  A Distributed Ap...
Medical Image Segmentation Using Hidden Markov Random Field A Distributed Ap...
 

More from Quoc-Sang Phan

All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...
All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...
All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...Quoc-Sang Phan
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo TheoriesQuantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo TheoriesQuoc-Sang Phan
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model CheckingQuoc-Sang Phan
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesQuoc-Sang Phan
 
Quantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuoc-Sang Phan
 
Quantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuoc-Sang Phan
 
Towards an SMT-based approach for Quantitative Information Flow
Towards an SMT-based approach for Quantitative Information FlowTowards an SMT-based approach for Quantitative Information Flow
Towards an SMT-based approach for Quantitative Information FlowQuoc-Sang Phan
 
Self-composition by Symbolic Execution
Self-composition by Symbolic ExecutionSelf-composition by Symbolic Execution
Self-composition by Symbolic ExecutionQuoc-Sang Phan
 
Symbolic Quantitative Information Flow
Symbolic Quantitative Information FlowSymbolic Quantitative Information Flow
Symbolic Quantitative Information FlowQuoc-Sang Phan
 

More from Quoc-Sang Phan (9)

All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...
All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...
All-Solution Satisfiability Modulo Theories: applications, algorithms and ben...
 
Quantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo TheoriesQuantifying Information Leaks via Model Counting Modulo Theories
Quantifying Information Leaks via Model Counting Modulo Theories
 
Concurrent Bounded Model Checking
Concurrent Bounded Model CheckingConcurrent Bounded Model Checking
Concurrent Bounded Model Checking
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo Theories
 
Quantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability Analysis
 
Quantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability AnalysisQuantifying Information Leaks using Reliability Analysis
Quantifying Information Leaks using Reliability Analysis
 
Towards an SMT-based approach for Quantitative Information Flow
Towards an SMT-based approach for Quantitative Information FlowTowards an SMT-based approach for Quantitative Information Flow
Towards an SMT-based approach for Quantitative Information Flow
 
Self-composition by Symbolic Execution
Self-composition by Symbolic ExecutionSelf-composition by Symbolic Execution
Self-composition by Symbolic Execution
 
Symbolic Quantitative Information Flow
Symbolic Quantitative Information FlowSymbolic Quantitative Information Flow
Symbolic Quantitative Information Flow
 

Recently uploaded

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 

Recently uploaded (20)

Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 

Model-counting Approaches For Nonlinear Numerical Constraints

  • 1. Model-counting Approaches For Nonlinear Numerical Constraints Mateus Borges1 , Sang Phan2 , Antonio Filieri1 , Corina P˘as˘areanu2,3 1Imperial College London, UK 2Carnegie Mellon University Silicon Valley, USA 3NASA Ames Research Center, USA NASA Formal Methods Symposium May 16, 2017 1 / 14
  • 2. Model Counting Applications of model counting probabilistic inference reliability analysis quantitative information flow (for side-channel analysis) . . . Integrated Symbolic Execution for Space-Time Analysis of Code. http://www.cmu.edu/silicon-valley/research/isstac 2 / 14
  • 3. Side channels H L “main” channelprogram (unintended) side channel main channel output of the program, i.e. return value side channels execution time power consumption number of packets transmitted over a network number of bytes written to a file . . . 3 / 14
  • 4. Symbolic Execution and Symbolic PathFinder 1 int x,y; 2 if(x > y){ 3 x = x + y; 4 y = x − y; 5 x = x − y; 6 if(x − y > 0) 7 assert(false); 8 } {x → X, y → Y } PC : True {x → X, y → Y } PC : X > Y {x → X + Y, y → Y } PC : X > Y {x → X + Y, y → X} PC : X > Y {x → Y, y → X} PC : X > Y {x → Y, y → X} PC : X > Y ∧ Y − X > 0 6 {x → Y, y → X} PC : X > Y ∧ Y − X ≤ 0 6 5 4 3 2 {x → X, y → Y } PC : X ≤ Y 2 Symbolic PathFinder: symbolic JVM for Java bytecode 4 / 14
  • 5. Side-channel analysis Quantifying information leaks Perform symbolic execution to collect all symbolic paths πi . Compute the observable of each symbolic path oi = cost(πi ). Compute the leakage using Shannon entropy Leakage = i=1...n p(oi ) log2 1 p(oi ) Assume the secret h has uniform distribution over the domain ΩH p(oi ) = cost(πj )=oi (πj ) |ΩH| where (πj ) is computed by using model counting tools. 5 / 14
  • 6. Motivation Most previous work limit on programs with linear numerical constraints (using Latte or barvinok). Reliability Analysis in SymbolicPathfinder. ICSE’13. Multi-run Side-Channel Analysis Using Symbolic Execution and Max-SMT. CSF’16. String Analysis for Side Channels with Segmented Oracles. FSE’16. Synthesis of Adaptive Side-Channel Attacks. CSF’17. ⇒ Model counting of path conditions for programs with nonlinear numerical constraints. 6 / 14
  • 7. Taxonomy of model counting Precision Exact counting Approximate counting Level Bit-level counting Word-level counting Others: Blocking-clause enumeration BDD-based enumerations Counting with Gr¨obner bases Brute force 7 / 14
  • 8. Evaluation setup Tool selection Publicly available implementations of model counting algorithms POC’s developed by us Fixed execution time (1 hour) Benchmark: Modular exponentiation Two distinct implementations Extracted path conditions through symbolic execution 8 / 14
  • 9. Evaluated Tools Precision Level All-SAT exact bit Dsharp exact bit SharpCDCL exact bit SharpSAT exact bit ApproxMC approximate bit SMTapproxMC approximate word Brute force exact word MathSAT exact word Z3 (blocking clause) exact word 9 / 14
  • 10. Modular Exponentiation Asymmetric cryptographic algorithms public key: (e,n) private key: d message: m encryption: c = modPow(m, e, n) decryption: m = modPow(c, d, n) Experiments with n = 1717 n = 834443 n = 1964903306 (product of two distinct prime numbers) modPow(x, y, z) = xy mod z int modPow1(int c, int d, int n){ int s = 1, y = c, res=0; while (d > 0) { if (d % 2 == 1) { //reduction: int tmp = s ∗ y; if (tmp > n){ tmp = tmp − n; } res = tmp % n; } else { res=s; } s = (res ∗ res) % n; d /= 2; } return res; } 10 / 14
  • 11. Modular Exponentiation SnapBuddy A photo-sharing web application. Given by DARPA as one of the engagement problems. public static BigInteger modPow2(final BigInteger x, final BigInteger y, final BigInteger z) { BigInteger s = BigInteger.valueOf(1L); for (int width = y.bitLength(), i = 0; i < width; ++i) { s = s.multiply(s).mod(z); if (y.testBit(width − i − 1)) { s = fastMultiply(s, x).mod(z); } } return s; } } 11 / 14
  • 12. Symbolic Execution of Modular Exponentiation modPow(x, y, z) = xy mod z Perform symbolic execution on modPow1 Both x and y are symbolic. z is either 1717, 834443, or 1964903306. modPow2 x is a concrete 1532-bit value. y is symbolic BigInteger with 40 bits. z is a concrete 1536-bit value (hard-coded in SnapBuddy) 12 / 14
  • 13. Experimental Results Subject a-1 a-2 a-3 a-4 a-5 a-6 a-7 b-1 b-2 b-3 b-4 N. Ops 11 26 15 37 121 57 117 250 243 1428 1428 Domain Size 10K 10K 10K 25M 25M 59B 59B 4T 4T 32B 32B N. Solutions 1.7K 7 1.7K 208K 109K 80M 77M 2B 66B 1 1 N. CNF clauses 40K 78K 58K 67K 114K 58K 78K 2K 2K 2K 2K Execution time BitBlasting 15s 30s 24s 25s 44s 23s 30s 1s 1s 1s 2s SharpCDCL 1s 1s 1s 43m - - - - - 1s 1s All-SAT 1s 8s 2s 31m∗ 59m∗ 15m∗ 19m∗ - - 1s 1s SharpSAT 5s 2s 11s 29m 53m - - 1s 1s 1s 1s Dsharp 12m 32s 22m - - - - 1s 1s 1s 1s ApproxMC (f) 4s 2s 5s 16s 32s 1m 1m 4s 5s 1s 1s ApproxMC (p) 4s 2s 6s 2m 5m 21m 24m 16s 25s 1s 1s SMTapproxMC (f) 6m 15m 8m - - - - - - 2m 2m SMTapproxMC (p) - 15m - - - - - - - 2m 2m MathSAT 2s 2s 5s 38m 54m - - - - 1s 1s Z3-BC 12s 3s 18s - - - - - - 1s 1s Brute Force 1s 1s 1s 1s 1s 8m 8m - - 2m 2m 13 / 14
  • 14. Conclusion Small domain: brute force! Exact counters can be effective when the problem is small (< 50K clauses) or count is close to domain size. Most promising: approximate model counting with bit-level hashing. Performance can degrade when increased precision is required. 14 / 14