SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Downloaden Sie, um offline zu lesen
Reasoning Loops over Arrays using Vampire
First-Order Theorem Prover for Loop Invariant Generation
Jeff Chen1
1Master Thesis in Formal Methods
Chalmers University
Thesis Presentation April 2016
Research Motivation
Why Invariants?
Software Eng. Using Formal Methods course
Model Checking (SPIN and JML) ⇒ KeY Verification
Verification of loops ⇒ Loop Invariant exercise by hand (GCD)
Loop Invariants
Tricky boundaries.
Obligation of programmer.
Essence of loops.
Existing System
Loop Invariant Gen. with Vampire
L. Kovcs and A. and A. Voronkov (2009).
”Finding Loop Invariants for Programs
over Arrays Using a Theorem Prover”
Static program analysis.
static properties (e.g
monotonic).
Invariants generation using
consequences finding.
Symbol elimination.
Alternating quantifiers.
W. Ahrendt, L. Kovcs and S. Robillard
(2015). ”Reasoning About Loops Using
Vampire in KeY”
Simple guarded language:
generic interface of
imperative languages.
Pre- Post-Conditions for
filtering and correctness.
Direct proof:
Post-condition inference.
Integration with KeY
framework.
Previously Failed Example: swap
1 int [] a, b, olda , oldb;
int i, alength , blength;
requires blength == alength , i == 0;
6 requires forall int i, 0 <= i
& i < blength ==> b[i] == oldb[i];
ensures forall int i, 0 <= i
& i < blength ==> a[i] == oldb[i];
11
while (i < alength) do
:: true -> a[i] = b[i];
b[i] = a[i];
i = i + 1;
16 od
Reason of Failure?
Array Reasoning
Some critical proof steps in swap test case with array reasoning.
...
20. ~(! [X3 : $int] : ($select(olda ,X3) = $select(b,X3)
| ~( $less(X3 ,blength) & $lesseq (0,X3 ))))
[program analysis]
...
63176. C0 $select(oldb ,sK5) = $select(a,sK5)
| $lesseq(alength ,$sum(-1,sK5))
| ~$lesseq (1,sK5) <- {10, 21, 22, 80}
[ superposition 1928 ,3952]
...
63634. C0 $false [AVATAR sat refutation
48074 ,47723 ,371 ,180 ,186 ,30241 ,340 ,341 ,3414 ,
63200 ,339 ,38750 ,30127 ,30141 ,30134 ,381 ,208 ,
214 ,44449 ,309 ,1780 ,1681 ,330 ,48112 ,45944 ,
48885 ,51852 ,47081 ,3177 ,3247 ,332 ,323 ,48525 ,
55659 ,331 ,63319 ,1668 ,1696 ,316]
Result Comparison
Testcase ∆direct created clauses
absolute 0.374 2095
copy 0.057 495
copyOdd 0.208 1571
copyPartial 0.047 426
copyPositive 530669
find 412821
findMax 324456
init 0.052 415
initEven 430518
initNonConstant 0.117 909
initPartial 0.060 495
inPlaceMax 362783
max 0.348 2140
mergeInterleave 376322
partition 622830
partitionInit 488387
reverse 0.079 593
strcpy 0.048 373
strlen 0.019 139
swap 812284
Testcase ∆direct created clauses
absolute 0.484 2614
copy 0.079 654
copyOdd 0.181 1098
copyPartial 0.104 800
copyPositive 46.238 89280
find 413352
findMax 398548
init 0.069 592
initEven 391735
initNonConstant 0.128 940
initPartial 0.069 593
inPlaceMax 530098
max 0.481 2634
mergeInterleave 543746
partition 97.519 210837
partitionInit 28.217 72989
reverse 0.098 733
strcpy 0.081 538
strlen 0.031 168
swap 11.218 61786
Conclusion
Vampire is a robust FO theorem prover, but much of the
complexity is dedicated for maintaining completeness.
Theory Reasoning does help the theorem prover in the case of
arrays, but also burdened superposition algorithm.
One can reuse/improve the static analysis part for better
reasoning.
AVATAR architecture is powerful and highly adoptive.
Programming should start from Correctness.
Future work of this project:
Boolean arrays reasoning (Vampire with FOOL).
Vampire + Z3 (SMT for arithmetics).

Weitere ähnliche Inhalte

Ähnlich wie Reasoning Loops over Arrays using Vampire

Visualizing the Model Selection Process
Visualizing the Model Selection ProcessVisualizing the Model Selection Process
Visualizing the Model Selection ProcessBenjamin Bengfort
 
Qu meeting PhD kessentini
Qu meeting PhD kessentiniQu meeting PhD kessentini
Qu meeting PhD kessentinikessentini
 
Qu meeting phd thesis kessentini
Qu meeting phd thesis kessentiniQu meeting phd thesis kessentini
Qu meeting phd thesis kessentinikessentini
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Sung Kim
 
A Configurable CEGAR Framework with Interpolation-Based Refinements
A Configurable CEGAR Framework with Interpolation-Based RefinementsA Configurable CEGAR Framework with Interpolation-Based Refinements
A Configurable CEGAR Framework with Interpolation-Based RefinementsAkos Hajdu
 
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)Liang Gong
 
LIDL Interaction Description Language presentation at FOMCHI 2015
LIDL Interaction Description Language presentation at FOMCHI 2015LIDL Interaction Description Language presentation at FOMCHI 2015
LIDL Interaction Description Language presentation at FOMCHI 2015Vincent Lecrubier
 
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)David Rosenblum
 
Mpp Rsv 2008 Public
Mpp Rsv 2008 PublicMpp Rsv 2008 Public
Mpp Rsv 2008 Publiclab13unisa
 
Artificial software diversity: automatic synthesis of program sosies
Artificial software diversity: automatic synthesis of program sosiesArtificial software diversity: automatic synthesis of program sosies
Artificial software diversity: automatic synthesis of program sosiesFoCAS Initiative
 
Higher-order organization of complex networks
Higher-order organization of complex networksHigher-order organization of complex networks
Higher-order organization of complex networksDavid Gleich
 
Bayesian modelling and computation for Raman spectroscopy
Bayesian modelling and computation for Raman spectroscopyBayesian modelling and computation for Raman spectroscopy
Bayesian modelling and computation for Raman spectroscopyMatt Moores
 
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...Davide Chicco
 
MuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for CMuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for CSusumu Tokumoto
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and AnalysisWiwat Ruengmee
 
Visual diagnostics for more effective machine learning
Visual diagnostics for more effective machine learningVisual diagnostics for more effective machine learning
Visual diagnostics for more effective machine learningBenjamin Bengfort
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewWaqas Nawaz
 
Streaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingStreaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingIstván Dávid
 
Encoding Linguistic Structures with Graph Convolutional Networks
Encoding Linguistic Structures with Graph Convolutional NetworksEncoding Linguistic Structures with Graph Convolutional Networks
Encoding Linguistic Structures with Graph Convolutional NetworksAleksandar Savkov
 

Ähnlich wie Reasoning Loops over Arrays using Vampire (20)

Visualizing the Model Selection Process
Visualizing the Model Selection ProcessVisualizing the Model Selection Process
Visualizing the Model Selection Process
 
Qu meeting PhD kessentini
Qu meeting PhD kessentiniQu meeting PhD kessentini
Qu meeting PhD kessentini
 
Qu meeting phd thesis kessentini
Qu meeting phd thesis kessentiniQu meeting phd thesis kessentini
Qu meeting phd thesis kessentini
 
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)Heterogeneous Defect Prediction (

ESEC/FSE 2015)
Heterogeneous Defect Prediction (

ESEC/FSE 2015)
 
A Configurable CEGAR Framework with Interpolation-Based Refinements
A Configurable CEGAR Framework with Interpolation-Based RefinementsA Configurable CEGAR Framework with Interpolation-Based Refinements
A Configurable CEGAR Framework with Interpolation-Based Refinements
 
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
DLint: dynamically checking bad coding practices in JavaScript (ISSTA'15 Slides)
 
LIDL Interaction Description Language presentation at FOMCHI 2015
LIDL Interaction Description Language presentation at FOMCHI 2015LIDL Interaction Description Language presentation at FOMCHI 2015
LIDL Interaction Description Language presentation at FOMCHI 2015
 
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)
The Challenges of Probabilistic Thinking (keynote talk at ICFEM 2017)
 
Mpp Rsv 2008 Public
Mpp Rsv 2008 PublicMpp Rsv 2008 Public
Mpp Rsv 2008 Public
 
Artificial software diversity: automatic synthesis of program sosies
Artificial software diversity: automatic synthesis of program sosiesArtificial software diversity: automatic synthesis of program sosies
Artificial software diversity: automatic synthesis of program sosies
 
Higher-order organization of complex networks
Higher-order organization of complex networksHigher-order organization of complex networks
Higher-order organization of complex networks
 
Bayesian modelling and computation for Raman spectroscopy
Bayesian modelling and computation for Raman spectroscopyBayesian modelling and computation for Raman spectroscopy
Bayesian modelling and computation for Raman spectroscopy
 
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...
A Discrete Optimization Approach for SVD Best Truncation Choice based on ROC ...
 
MuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for CMuVM: Higher Order Mutation Analysis Virtual Machine for C
MuVM: Higher Order Mutation Analysis Virtual Machine for C
 
Pointcuts and Analysis
Pointcuts and AnalysisPointcuts and Analysis
Pointcuts and Analysis
 
Visual diagnostics for more effective machine learning
Visual diagnostics for more effective machine learningVisual diagnostics for more effective machine learning
Visual diagnostics for more effective machine learning
 
Simulation Software Performances And Examples
Simulation Software Performances And ExamplesSimulation Software Performances And Examples
Simulation Software Performances And Examples
 
Design and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract ViewDesign and analysis of algorithms - Abstract View
Design and analysis of algorithms - Abstract View
 
Streaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event ProcessingStreaming Model Transformations by Complex Event Processing
Streaming Model Transformations by Complex Event Processing
 
Encoding Linguistic Structures with Graph Convolutional Networks
Encoding Linguistic Structures with Graph Convolutional NetworksEncoding Linguistic Structures with Graph Convolutional Networks
Encoding Linguistic Structures with Graph Convolutional Networks
 

Kürzlich hochgeladen

(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxpriyankatabhane
 
CHROMATOGRAPHY PALLAVI RAWAT.pptx
CHROMATOGRAPHY  PALLAVI RAWAT.pptxCHROMATOGRAPHY  PALLAVI RAWAT.pptx
CHROMATOGRAPHY PALLAVI RAWAT.pptxpallavirawat456
 
basic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomybasic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomyDrAnita Sharma
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingNetHelix
 
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxGENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxRitchAndruAgustin
 
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024Jene van der Heide
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxThermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxuniversity
 
User Guide: Orion™ Weather Station (Columbia Weather Systems)
User Guide: Orion™ Weather Station (Columbia Weather Systems)User Guide: Orion™ Weather Station (Columbia Weather Systems)
User Guide: Orion™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxmalonesandreagweneth
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)Columbia Weather Systems
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuinethapagita
 

Kürzlich hochgeladen (20)

(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 
Speech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptxSpeech, hearing, noise, intelligibility.pptx
Speech, hearing, noise, intelligibility.pptx
 
CHROMATOGRAPHY PALLAVI RAWAT.pptx
CHROMATOGRAPHY  PALLAVI RAWAT.pptxCHROMATOGRAPHY  PALLAVI RAWAT.pptx
CHROMATOGRAPHY PALLAVI RAWAT.pptx
 
basic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomybasic entomology with insect anatomy and taxonomy
basic entomology with insect anatomy and taxonomy
 
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editingBase editing, prime editing, Cas13 & RNA editing and organelle base editing
Base editing, prime editing, Cas13 & RNA editing and organelle base editing
 
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxGENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
 
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptxThermodynamics ,types of system,formulae ,gibbs free energy .pptx
Thermodynamics ,types of system,formulae ,gibbs free energy .pptx
 
User Guide: Orion™ Weather Station (Columbia Weather Systems)
User Guide: Orion™ Weather Station (Columbia Weather Systems)User Guide: Orion™ Weather Station (Columbia Weather Systems)
User Guide: Orion™ Weather Station (Columbia Weather Systems)
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
 
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
User Guide: Pulsar™ Weather Station (Columbia Weather Systems)
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 GenuineCall Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
Call Girls in Majnu Ka Tilla Delhi 🔝9711014705🔝 Genuine
 

Reasoning Loops over Arrays using Vampire

  • 1. Reasoning Loops over Arrays using Vampire First-Order Theorem Prover for Loop Invariant Generation Jeff Chen1 1Master Thesis in Formal Methods Chalmers University Thesis Presentation April 2016
  • 2. Research Motivation Why Invariants? Software Eng. Using Formal Methods course Model Checking (SPIN and JML) ⇒ KeY Verification Verification of loops ⇒ Loop Invariant exercise by hand (GCD) Loop Invariants Tricky boundaries. Obligation of programmer. Essence of loops.
  • 3. Existing System Loop Invariant Gen. with Vampire L. Kovcs and A. and A. Voronkov (2009). ”Finding Loop Invariants for Programs over Arrays Using a Theorem Prover” Static program analysis. static properties (e.g monotonic). Invariants generation using consequences finding. Symbol elimination. Alternating quantifiers. W. Ahrendt, L. Kovcs and S. Robillard (2015). ”Reasoning About Loops Using Vampire in KeY” Simple guarded language: generic interface of imperative languages. Pre- Post-Conditions for filtering and correctness. Direct proof: Post-condition inference. Integration with KeY framework.
  • 4. Previously Failed Example: swap 1 int [] a, b, olda , oldb; int i, alength , blength; requires blength == alength , i == 0; 6 requires forall int i, 0 <= i & i < blength ==> b[i] == oldb[i]; ensures forall int i, 0 <= i & i < blength ==> a[i] == oldb[i]; 11 while (i < alength) do :: true -> a[i] = b[i]; b[i] = a[i]; i = i + 1; 16 od
  • 6. Array Reasoning Some critical proof steps in swap test case with array reasoning. ... 20. ~(! [X3 : $int] : ($select(olda ,X3) = $select(b,X3) | ~( $less(X3 ,blength) & $lesseq (0,X3 )))) [program analysis] ... 63176. C0 $select(oldb ,sK5) = $select(a,sK5) | $lesseq(alength ,$sum(-1,sK5)) | ~$lesseq (1,sK5) <- {10, 21, 22, 80} [ superposition 1928 ,3952] ... 63634. C0 $false [AVATAR sat refutation 48074 ,47723 ,371 ,180 ,186 ,30241 ,340 ,341 ,3414 , 63200 ,339 ,38750 ,30127 ,30141 ,30134 ,381 ,208 , 214 ,44449 ,309 ,1780 ,1681 ,330 ,48112 ,45944 , 48885 ,51852 ,47081 ,3177 ,3247 ,332 ,323 ,48525 , 55659 ,331 ,63319 ,1668 ,1696 ,316]
  • 7. Result Comparison Testcase ∆direct created clauses absolute 0.374 2095 copy 0.057 495 copyOdd 0.208 1571 copyPartial 0.047 426 copyPositive 530669 find 412821 findMax 324456 init 0.052 415 initEven 430518 initNonConstant 0.117 909 initPartial 0.060 495 inPlaceMax 362783 max 0.348 2140 mergeInterleave 376322 partition 622830 partitionInit 488387 reverse 0.079 593 strcpy 0.048 373 strlen 0.019 139 swap 812284 Testcase ∆direct created clauses absolute 0.484 2614 copy 0.079 654 copyOdd 0.181 1098 copyPartial 0.104 800 copyPositive 46.238 89280 find 413352 findMax 398548 init 0.069 592 initEven 391735 initNonConstant 0.128 940 initPartial 0.069 593 inPlaceMax 530098 max 0.481 2634 mergeInterleave 543746 partition 97.519 210837 partitionInit 28.217 72989 reverse 0.098 733 strcpy 0.081 538 strlen 0.031 168 swap 11.218 61786
  • 8. Conclusion Vampire is a robust FO theorem prover, but much of the complexity is dedicated for maintaining completeness. Theory Reasoning does help the theorem prover in the case of arrays, but also burdened superposition algorithm. One can reuse/improve the static analysis part for better reasoning. AVATAR architecture is powerful and highly adoptive. Programming should start from Correctness. Future work of this project: Boolean arrays reasoning (Vampire with FOOL). Vampire + Z3 (SMT for arithmetics).