SlideShare a Scribd company logo
Program
Verification
Using Spec#
Motivation
• Prove correctness of
the program
• Cost effective way to
develop and maintain
high-quality
software.
Road Map
• Design by Contract
• Spec# Architecture
• Demo
Design by Contract
• First appeared in Eiffel
• formal, precise and
verifiable interface
Pre Conditions
class ArrayList {
public virtual void Insert( int index , object value)
requires 0 <= index && index <= Count; //Pre condition
{ }
Post Conditions
class ArrayList {
public virtual void Insert( int index , object value)
requires 0 <= index && index <= Count;
ensures Count == old(Count) + 1; //Post conditions
ensures value == this[index];
{ }
Not Enough
• Method Constructs
not enough
• Enforce constraints on
private members?
• Abstraction Violation?
• How to ensure object’s
state?
Object Invariants
class SortOrder {
ItemsList[ ]! randomList;
ItemsList[ ]! sortedList;
invariant randomList.Length == sortedList .Length;
Blame Game
• Require failure =>
Blame the
method caller (Client)
Ensure failure =>
Blame the
method implementor
(Provider)
Spec# Architecture
Spec# Compiler
Verification Code Generator (Boogie)
Automatic Theorem Prover (Boogie)
Why extend C#???
• Non Null Types
• Method Contracts
• Checked / Unchecked
Exceptions
Non Nullable Types
public class Program
{
public static void Main(string![]!args)
{
for (int i=0; i< args.Length; i++)
{
Console.WriteLine(arg[i]);
}
Console.ReadLine();
}
}
Exceptions
Failures
Provider
Admissible
Observed
Program
Errors
Client
Assertions???
• Why just simple assertions can’t help?
• Callbacks, Multi Threads, Inheritance
Code Comparison
C#
public class SomeClass
{
public SomeClass()
{
}
public int SomeMethod(int i)
{
return 50/i;
}
}
Spec#
public class SomeClass
{
public SomeClass()
{
}
public int SomeMethod(int i)
requires i != 0;
{
return 50/i;
}
}
IL (C#)
.method public hidebysig instance int32 SomeMethod(int32 i) cil managed
{
// Code size 5 (0x5)
.maxstack 8
IL_0000: ldc.i4.s 50
IL_0002: ldarg.1
IL_0003: div
IL_0004: ret
} // end of method SomeClass::SomeMethod
IL (Spec#)
.method public hidebysig instance int32 SomeMethod(int32 i) cil managed{
.custom instance void
[System.Compiler.Runtime]Microsoft.Contracts.EnsuresAttribute::.ctor(string) = smthng
.locals init (int32 V_0, class
[System.Compiler.Runtime]Microsoft.Contracts.ContractMarkerException V_1, int32 V_2)
// Some Usual Operations
.try
{
….
IL_0016: ldstr "Postcondition 'i != 0' violated from method
classLibrary1.SomeClass.SomeMethod(System.Int32)'"
IL_001b: newobj instance void
[System.Compiler.Runtime]Microsoft.Contracts.EnsuresException::.ctor(string)
IL_0020: throw
….
} // end .try
….
IL_002e: ret
} // end of method SomeClass::SomeMethod
Runtime Checks
• Preconditions and
postconditions are
turned into inlined
code
• Performance
• Extra methods and
fields in the compiled
code
Automated Theorem Prover
• BoogiePL
• Simplify Theorem Prover
• Propositional Calculus
Demo

More Related Content

Viewers also liked

Program verification
Program verificationProgram verification
Program verification
hyunglak kim
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison
Computer Science Club
 
Theorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challengesTheorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challenges
Lawrence Paulson
 
Автоматическое доказательство теорем
Автоматическое доказательство теоремАвтоматическое доказательство теорем
Автоматическое доказательство теорем
Tech Talks @NSU
 
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Shunji Nishimura
 
Desafío cs sociales 1
Desafío cs sociales 1Desafío cs sociales 1
Desafío cs sociales 1
graasuncion
 
A Survey of functional verification techniques
A Survey of functional verification techniquesA Survey of functional verification techniques
A Survey of functional verification techniques
IJSRD
 
Automated theorem proving for special functions: the next phase
Automated theorem proving for special functions: the next phaseAutomated theorem proving for special functions: the next phase
Automated theorem proving for special functions: the next phase
Lawrence Paulson
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 session
Sameh El-Ashry
 
Big data solutions in Azure
Big data solutions in AzureBig data solutions in Azure
Big data solutions in Azure
Mostafa
 
Build intelligent solutions using Azure
Build intelligent solutions using AzureBuild intelligent solutions using Azure
Build intelligent solutions using Azure
Mostafa
 
Extending Product Outreach with Outlook Connectors
Extending Product Outreach with Outlook ConnectorsExtending Product Outreach with Outlook Connectors
Extending Product Outreach with Outlook Connectors
Mostafa
 
Formal Verification Techniques
Formal Verification TechniquesFormal Verification Techniques
Formal Verification Techniques
DVClub
 
Introducing Power BI Embedded
Introducing Power BI EmbeddedIntroducing Power BI Embedded
Introducing Power BI Embedded
Mostafa
 
Formal verification
Formal verificationFormal verification
Formal verification
DIlawar Singh
 

Viewers also liked (15)

Program verification
Program verificationProgram verification
Program verification
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison
 
Theorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challengesTheorem proving and the real numbers: overview and challenges
Theorem proving and the real numbers: overview and challenges
 
Автоматическое доказательство теорем
Автоматическое доказательство теоремАвтоматическое доказательство теорем
Автоматическое доказательство теорем
 
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
Theorem-proving Verification of Multi-clock Synchronous Circuits on Multimoda...
 
Desafío cs sociales 1
Desafío cs sociales 1Desafío cs sociales 1
Desafío cs sociales 1
 
A Survey of functional verification techniques
A Survey of functional verification techniquesA Survey of functional verification techniques
A Survey of functional verification techniques
 
Automated theorem proving for special functions: the next phase
Automated theorem proving for special functions: the next phaseAutomated theorem proving for special functions: the next phase
Automated theorem proving for special functions: the next phase
 
Functional verification techniques EW16 session
Functional verification techniques  EW16 sessionFunctional verification techniques  EW16 session
Functional verification techniques EW16 session
 
Big data solutions in Azure
Big data solutions in AzureBig data solutions in Azure
Big data solutions in Azure
 
Build intelligent solutions using Azure
Build intelligent solutions using AzureBuild intelligent solutions using Azure
Build intelligent solutions using Azure
 
Extending Product Outreach with Outlook Connectors
Extending Product Outreach with Outlook ConnectorsExtending Product Outreach with Outlook Connectors
Extending Product Outreach with Outlook Connectors
 
Formal Verification Techniques
Formal Verification TechniquesFormal Verification Techniques
Formal Verification Techniques
 
Introducing Power BI Embedded
Introducing Power BI EmbeddedIntroducing Power BI Embedded
Introducing Power BI Embedded
 
Formal verification
Formal verificationFormal verification
Formal verification
 

Similar to Program Verification / Automated Theorem Proving

Enhance Your Code Quality with Code Contracts
Enhance Your Code Quality with Code ContractsEnhance Your Code Quality with Code Contracts
Enhance Your Code Quality with Code Contracts
Eran Stiller
 
Visual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your ProductivityVisual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your Productivity
Denis Voituron
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
Jeremy Likness
 
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
BIWUG
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
Steven Smith
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
Siraj Memon
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
Dror Helper
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
Peter Hendriks
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
Olivera Milenkovic
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
Steven Smith
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
Steven Smith
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDTEclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
Elena Laskavaia
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
NIKHIL NAWATHE
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
Dror Helper
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at Jet
C4Media
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Полезные метрики покрытия. Практический опыт и немного теории
Полезные метрики покрытия. Практический опыт и немного теорииПолезные метрики покрытия. Практический опыт и немного теории
Полезные метрики покрытия. Практический опыт и немного теории
SQALab
 
Pragmatic Code Coverage
Pragmatic Code CoveragePragmatic Code Coverage
Pragmatic Code Coverage
Alexandre (Shura) Iline
 
Practicing Red, Green, Refactor!
Practicing Red, Green, Refactor!Practicing Red, Green, Refactor!
Practicing Red, Green, Refactor!
XPDays
 

Similar to Program Verification / Automated Theorem Proving (20)

Enhance Your Code Quality with Code Contracts
Enhance Your Code Quality with Code ContractsEnhance Your Code Quality with Code Contracts
Enhance Your Code Quality with Code Contracts
 
Visual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your ProductivityVisual Studio 2015: Increase your Productivity
Visual Studio 2015: Increase your Productivity
 
Introduction to TypeScript
Introduction to TypeScriptIntroduction to TypeScript
Introduction to TypeScript
 
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
SharePoint Saturday Belgium 2014 - Production debugging of SharePoint applica...
 
Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016Improving the Quality of Existing Software - DevIntersection April 2016
Improving the Quality of Existing Software - DevIntersection April 2016
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
Writing clean code in C# and .NET
Writing clean code in C# and .NETWriting clean code in C# and .NET
Writing clean code in C# and .NET
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
 
CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019CodeChecker Overview Nov 2019
CodeChecker Overview Nov 2019
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
 
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDTEclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
Eclipse Con 2015: Codan - a C/C++ Code Analysis Framework for CDT
 
Code Analysis-run time error prediction
Code Analysis-run time error predictionCode Analysis-run time error prediction
Code Analysis-run time error prediction
 
Unit tests & TDD
Unit tests & TDDUnit tests & TDD
Unit tests & TDD
 
Microservices Chaos Testing at Jet
Microservices Chaos Testing at JetMicroservices Chaos Testing at Jet
Microservices Chaos Testing at Jet
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Полезные метрики покрытия. Практический опыт и немного теории
Полезные метрики покрытия. Практический опыт и немного теорииПолезные метрики покрытия. Практический опыт и немного теории
Полезные метрики покрытия. Практический опыт и немного теории
 
Pragmatic Code Coverage
Pragmatic Code CoveragePragmatic Code Coverage
Pragmatic Code Coverage
 
Practicing Red, Green, Refactor!
Practicing Red, Green, Refactor!Practicing Red, Green, Refactor!
Practicing Red, Green, Refactor!
 

Recently uploaded

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
Alex Pruden
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
DianaGray10
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
saastr
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 

Recently uploaded (20)

5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
zkStudyClub - LatticeFold: A Lattice-based Folding Scheme and its Application...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectorsConnector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
Connector Corner: Seamlessly power UiPath Apps, GenAI with prebuilt connectors
 
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
9 CEO's who hit $100m ARR Share Their Top Growth Tactics Nathan Latka, Founde...
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 

Program Verification / Automated Theorem Proving

  • 2. Motivation • Prove correctness of the program • Cost effective way to develop and maintain high-quality software.
  • 3. Road Map • Design by Contract • Spec# Architecture • Demo
  • 4. Design by Contract • First appeared in Eiffel • formal, precise and verifiable interface
  • 5. Pre Conditions class ArrayList { public virtual void Insert( int index , object value) requires 0 <= index && index <= Count; //Pre condition { }
  • 6. Post Conditions class ArrayList { public virtual void Insert( int index , object value) requires 0 <= index && index <= Count; ensures Count == old(Count) + 1; //Post conditions ensures value == this[index]; { }
  • 7. Not Enough • Method Constructs not enough • Enforce constraints on private members? • Abstraction Violation? • How to ensure object’s state?
  • 8. Object Invariants class SortOrder { ItemsList[ ]! randomList; ItemsList[ ]! sortedList; invariant randomList.Length == sortedList .Length;
  • 9. Blame Game • Require failure => Blame the method caller (Client) Ensure failure => Blame the method implementor (Provider)
  • 10. Spec# Architecture Spec# Compiler Verification Code Generator (Boogie) Automatic Theorem Prover (Boogie)
  • 11. Why extend C#??? • Non Null Types • Method Contracts • Checked / Unchecked Exceptions
  • 12. Non Nullable Types public class Program { public static void Main(string![]!args) { for (int i=0; i< args.Length; i++) { Console.WriteLine(arg[i]); } Console.ReadLine(); } }
  • 14. Assertions??? • Why just simple assertions can’t help? • Callbacks, Multi Threads, Inheritance
  • 15. Code Comparison C# public class SomeClass { public SomeClass() { } public int SomeMethod(int i) { return 50/i; } } Spec# public class SomeClass { public SomeClass() { } public int SomeMethod(int i) requires i != 0; { return 50/i; } }
  • 16. IL (C#) .method public hidebysig instance int32 SomeMethod(int32 i) cil managed { // Code size 5 (0x5) .maxstack 8 IL_0000: ldc.i4.s 50 IL_0002: ldarg.1 IL_0003: div IL_0004: ret } // end of method SomeClass::SomeMethod
  • 17. IL (Spec#) .method public hidebysig instance int32 SomeMethod(int32 i) cil managed{ .custom instance void [System.Compiler.Runtime]Microsoft.Contracts.EnsuresAttribute::.ctor(string) = smthng .locals init (int32 V_0, class [System.Compiler.Runtime]Microsoft.Contracts.ContractMarkerException V_1, int32 V_2) // Some Usual Operations .try { …. IL_0016: ldstr "Postcondition 'i != 0' violated from method classLibrary1.SomeClass.SomeMethod(System.Int32)'" IL_001b: newobj instance void [System.Compiler.Runtime]Microsoft.Contracts.EnsuresException::.ctor(string) IL_0020: throw …. } // end .try …. IL_002e: ret } // end of method SomeClass::SomeMethod
  • 18. Runtime Checks • Preconditions and postconditions are turned into inlined code • Performance • Extra methods and fields in the compiled code
  • 19. Automated Theorem Prover • BoogiePL • Simplify Theorem Prover • Propositional Calculus
  • 20. Demo

Editor's Notes

  1. Misconceptions .NET Exp
  2. Correctness / Robustness => File Corruption, Mars Rover Software failures are expensive. Life + Money
  3. Client – Provider Di Provider’s Responsibility Client’s Responsibility
  4. programmer ‘s assumption => precondition Client should invoke in legal state
  5. steady state of the object between public methods Ensures this condition for all public method calls
  6. null-dereference errors => language providing the ability to discriminate between expressions that may evaluate to null and those that are sure not to
  7. Admissible => Parity Check, Timeout Observed Error => Array Bound Exception, Intrinsic Out of Memory Admissible => Checked correct programs never exhibit client failures or observed program errors
  8. Custom CLR attr Emit code for runtime checks Justifies !Annotation
  9. an intermediate language for program analysis and program verification procedural language for checking object-oriented programs one can then generate verification conditions