SlideShare a Scribd company logo
Alias Calculus for Simple Imperative Language with Decidable Pointer Arithmetic 
Aleksandr Vorontsov1, 
Aizhan Satekbayeva2, 
Nikolay Shilov3,4 
М1Novosibirsk State University, Novosibirsk, Russia, 
2 L.N. Gumilyov Eurasian National University, Astana, Kazakhstan, 
3Nazarbayev University, Astana, Kazakhstan, 
4A.P. Ershov Institute of Informatics Systems, Novosibirsk, Russia
What is “Alias Calculus”? 
•Alias calculus was proposed by Bertrand Meyer in 2011 for a toy programming language with single data type for abstract pointers. 
•it is a set of syntax-driven rules to compute an upper approximation aft(S, P) for aliasing after execution of a program P for a given initial aliasing S. 
14.11.2014 
2 
TMPA-2014: Alias Calculus
What about this Research 
•Our current purpose is to present a variant of alias calculus for more realistic programming language with automatic and dynamic memory, with types for regular data as well as for decidable pointer arithmetic. 
14.11.2014 
3 
TMPA-2014: Alias Calculus
Why a new Research? 
•Aliasing problem is to predict, detect and/or trace pointers to the same addresses in dynamic memory. 
•Importance of the problem is due to mistakes and errors that may happen in program run- time due to improper alias handling. 
14.11.2014 
4 
TMPA-2014: Alias Calculus
Errors? 
•Below are two simple examples of errors (?) inC-like pseudo-code: 
•x = malloc(sizeof(int)); 
x = malloc(sizeof(int)); 
//memory leak; 
•y = x; free(x); free(y); 
// invalid access. 
14.11.2014 
5 
TMPA-2014: Alias Calculus
Alias Calculus for a Trivial Language 
•Bertrand Meyer: Steps Towards a Theory and Calculus of Aliasing. Int. J. of Software and Informatics (Festschrift in honor of Manfred Broy), 2011., p.77-115. 
14.11.2014 
6 
TMPA-2014: Alias Calculus
Sample Rules: memory dynamics 
•Memory deallocation and allocation operators have the same effect on alias relation because after these operations variable isn’t alias to any other variable: 
14.11.2014 
7 
TMPA-2014: Alias Calculus
Sample Rules: assignment 
•After assignment address variable forgets all its former aliases and becomes an alias to all aliases of the variable: 
14.11.2014 
8 
TMPA-2014: Alias Calculus
Sample Rules: assignment 
14.11.2014 
9 
TMPA-2014: Alias Calculus 
x, y 
y, u 
x, z 
x, y 
x, y, u 
x:=y
Sample Rules: compound programs 
•Sequential composition means sequential application: 
•Nondeterministic choice of any branch: 
14.11.2014 
TMPA-2014: Alias Calculus 
10
Towards More Realistic Language 
•Acronym MoRe stays for More Realistic programming language. 
•It has two data types that are called addresses and integers with implicit type casting in2ad from integers to addresses. 
14.11.2014 
TMPA-2014: Alias Calculus 
11
Addresses in MoRe 
•Address data type is any (finite or infinite) set of values ADR with constants denoted “0” and “1”, operations denoted “+” and “–” such that (ADR, 0, 1, +, –) is a commutative additive semi-group with decidable first-order theory TADR. 
14.11.2014 
TMPA-2014: Alias Calculus 
12
Examples of Legal Address Types 
•Zm, the ring of residuals modulo any particular fixed positive m, 
•Presburger arithmetic, etc. 
14.11.2014 
TMPA-2014: Alias Calculus 
13
Integers in MoRe 
•Integer data type in MoRe is any (finite or infinite) set of (mathematical) integers INT with standard constants 0 and 1, standard operations “+”, “–”, “*”, “/” and implicit computable surjective homomorphical type- casting function 
in2ad : (INT, 0, 1, +, –)  (ADR, 0, 1, +, –) . 
14.11.2014 
TMPA-2014: Alias Calculus 
14
MoRe Syntax 
14.11.2014 
TMPA-2014: Alias Calculus 
15
Structural Operational Semantics 
•MoRe SOS uses (memory) model consisting of two disjoint parts: a static memory (conventionally) called stack and dynamic memory (conventionally) called heap. 
14.11.2014 
TMPA-2014: Alias Calculus 
16
Structural Operational Semantics 
•State is a pair of mappings s=(st, hp) where 
•state of the stack st: V  INT is a partial mapping (with finite domain) from variables V to integers INT (understood as their values), 
•state of the heap hp: ADR  INT i.e. a partial mapping with finite domain from addresses ADR to integers INT (understood as referenced values). 
14.11.2014 
TMPA-2014: Alias Calculus 
17
Structural Operational Semantics 
•MoRe SOS is axiomatic system for triples 
s s 
where s is a state, s is a state or an exception abort, and  is a program. 
•Intuition behind this triple follows: program converts input state into output state (that may be exception). 
14.11.2014 
TMPA-2014: Alias Calculus 
18
Structural Operational Semantics 
•SOS inference rules are syntax-driven and have the following form: 
14.11.2014 
TMPA-2014: Alias Calculus 
19
Sample SOS Rule: static array in dynamic memory 
•If 
–xdom(st), 
–addresses in2ad(l), … in2ad(l+k) are disjoint, 
–in2ad(l), … in2ad(l+k)dom(hp) 
then 
14.11.2014 
TMPA-2014: Alias Calculus 
20
Alias Calculus for MoRe 
•A configuration is a quadruple Cnf=(I, A, S) consisting of 
–a sets of address variables, 
–a set of address expressions , 
–a finite set S of pairs of synonyms and antonyms (with variables in I) that has a solution as a system of equalities and inequalities in (ADR, 0, 1, +, –), i.e. that is consistent with theory TADR. 
14.11.2014 
TMPA-2014: Alias Calculus 
21
Alias Calculus for MoRe 
•Informally speaking in Cnf=(I, A, S) 
–the set I is for initialized address variables, 
–the set A is for address expressions that points onto allocated memory, 
–the set S is a system of equations and inequalities to specify what expressions may be aliases and what can’t be. 
14.11.2014 
TMPA-2014: Alias Calculus 
22
Sample Rule of Alias Calculus: assignment 
•Let Cnfx:=t be (Ix:=t , Ax:=t , Sx:=t) where 
14.11.2014 
TMPA-2014: Alias Calculus 
23
Main Result 
•The alias calculus for programming language MoRe is safe in the following sense: 
•Theorem: Let D be any alias distribution,  be any MoRe-program and s=(st, hp) be any state such that st╞D; if s=(st,hp) is a state such that s<>s then st╞aft(D,). 
14.11.2014 
TMPA-2014: Alias Calculus 
24
Conclusion 
•Equation based alias calculus for a model programming language with dynamic memory and decidable address arithmetic was developed. 
•The calculus can be used for control-flow insensitive safe alias analysis of MoRe programs but for practical applications the language must be much more realistic. 
14.11.2014 
TMPA-2014: Alias Calculus 
25
14.11.2014 
TMPA-2014: Alias Calculus 
26 
Thank You For Your Attention! 
Questions?

More Related Content

PPTX
Matlab presentation
PPTX
Mathematical Modeling With Maple
DOCX
Relational Algebra Operations
PPT
Ch6 formal relational query languages
DOCX
Assignment on different types of addressing modes
PPT
14. Query Optimization in DBMS
PPTX
4. languages and grammars
PDF
15 functional programming
Matlab presentation
Mathematical Modeling With Maple
Relational Algebra Operations
Ch6 formal relational query languages
Assignment on different types of addressing modes
14. Query Optimization in DBMS
4. languages and grammars
15 functional programming

What's hot (20)

PPTX
Unit 2 linked list
PDF
Intermediate code generation in Compiler Design
PPT
Intermediate code generation (Compiler Design)
PPTX
Data structures and algorithms
PPT
358 33 powerpoint-slides_8-linked-lists_chapter-8
PPTX
Query Optimization
PPT
Relational algebra.pptx
PPTX
MATLAB - The Need to Know Basics
PDF
Query Optimization - Brandon Latronica
PPTX
5 top-down-parsers
PPT
Chapter 6 intermediate code generation
DOC
Compiler Design QA
PPTX
Relational algebra dbms (2130703) - 160920107003
PPTX
Data structure using c module 1
PPTX
Polymath For Chemical Engineers
PDF
Source coding for a mixed source: determination of second order asymptotics
PPTX
Procedures And Functions in Matlab
PPT
Chapter Eight(2)
PPT
Relational Algebra
Unit 2 linked list
Intermediate code generation in Compiler Design
Intermediate code generation (Compiler Design)
Data structures and algorithms
358 33 powerpoint-slides_8-linked-lists_chapter-8
Query Optimization
Relational algebra.pptx
MATLAB - The Need to Know Basics
Query Optimization - Brandon Latronica
5 top-down-parsers
Chapter 6 intermediate code generation
Compiler Design QA
Relational algebra dbms (2130703) - 160920107003
Data structure using c module 1
Polymath For Chemical Engineers
Source coding for a mixed source: determination of second order asymptotics
Procedures And Functions in Matlab
Chapter Eight(2)
Relational Algebra
Ad

Similar to Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithmetic (20)

PDF
Standardizing arrays -- Microsoft Presentation
PPT
chapter 5.ppt
PPTX
iii-ii cd nCompiler design UNIT-V-1.pptx
PPTX
Rattle Graphical Interface for R Language
PDF
p138-jiang
PDF
Lexical analysis - Compiler Design
PDF
Integration of speech recognition with computer assisted translation
PDF
lecture1422914957.pdf
PDF
Compiler Design Lecture Notes
PDF
Compiler Design Full Curse
PPTX
Datamining with R
PPTX
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
PDF
MatFast: In-Memory Distributed Matrix Computation Processing and Optimization...
PDF
SparkR Best Practices for R Data Scientists
PDF
SparkR best practices for R data scientist
PDF
Canonical Formatted Address Data
PDF
Canonical Formatted Address Data
PDF
Data Structures And Algorithms Roadmap for Beginners By ScholarHat PDF
PPTX
DMDW Lesson 08 - Further Data Mining Algorithms
PPT
Designing A Syntax Based Retrieval System03
Standardizing arrays -- Microsoft Presentation
chapter 5.ppt
iii-ii cd nCompiler design UNIT-V-1.pptx
Rattle Graphical Interface for R Language
p138-jiang
Lexical analysis - Compiler Design
Integration of speech recognition with computer assisted translation
lecture1422914957.pdf
Compiler Design Lecture Notes
Compiler Design Full Curse
Datamining with R
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
MatFast: In-Memory Distributed Matrix Computation Processing and Optimization...
SparkR Best Practices for R Data Scientists
SparkR best practices for R data scientist
Canonical Formatted Address Data
Canonical Formatted Address Data
Data Structures And Algorithms Roadmap for Beginners By ScholarHat PDF
DMDW Lesson 08 - Further Data Mining Algorithms
Designing A Syntax Based Retrieval System03
Ad

More from Iosif Itkin (20)

PDF
Foundations of Software Testing Lecture 4
PPTX
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
PDF
Exactpro FinTech Webinar - Global Exchanges Test Oracles
PDF
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
PDF
Operational Resilience in Financial Market Infrastructures
PDF
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
PDF
Testing the Intelligence of your AI
PDF
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
PDF
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
PPTX
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
PDF
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
PDF
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
PPTX
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
PDF
QA Community Saratov: Past, Present, Future (2019-02-08)
PDF
Machine Learning and RoboCop Testing
PDF
Behaviour Driven Development: Oltre i limiti del possibile
PDF
2018 - Exactpro Year in Review
PPTX
Exactpro Discussion about Joy and Strategy
PPTX
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
PDF
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)
Foundations of Software Testing Lecture 4
QA Financial Forum London 2021 - Automation in Software Testing. Humans and C...
Exactpro FinTech Webinar - Global Exchanges Test Oracles
Exactpro FinTech Webinar - Global Exchanges FIX Protocol
Operational Resilience in Financial Market Infrastructures
20 Simple Questions from Exactpro for Your Enjoyment This Holiday Season
Testing the Intelligence of your AI
EXTENT 2019: Exactpro Quality Assurance for Financial Market Infrastructures
ClearTH Test Automation Framework: Case Study in IRS & CDS Swaps Lifecycle Mo...
EXTENT Talks 2019 Tbilisi: Failover and Recovery Test Automation - Ivan Shamrai
EXTENT Talks QA Community Tbilisi 20 April 2019 - Conference Open
User-Assisted Log Analysis for Quality Control of Distributed Fintech Applica...
QAFF Chicago 2019 - Complex Post-Trade Systems, Requirements Traceability and...
QA Community Saratov: Past, Present, Future (2019-02-08)
Machine Learning and RoboCop Testing
Behaviour Driven Development: Oltre i limiti del possibile
2018 - Exactpro Year in Review
Exactpro Discussion about Joy and Strategy
FIX EMEA Conference 2018 - Post Trade Software Testing Challenges
BDD. The Outer Limits. Iosif Itkin at Youcon (in Russian)

Recently uploaded (20)

PPT
protein biochemistry.ppt for university classes
PPTX
famous lake in india and its disturibution and importance
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PDF
Sciences of Europe No 170 (2025)
PPTX
Introduction to Cardiovascular system_structure and functions-1
PPTX
Cell Membrane: Structure, Composition & Functions
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PPTX
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PPTX
BIOMOLECULES PPT........................
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PPTX
Microbiology with diagram medical studies .pptx
PDF
HPLC-PPT.docx high performance liquid chromatography
PPTX
2. Earth - The Living Planet Module 2ELS
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
DOCX
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx
protein biochemistry.ppt for university classes
famous lake in india and its disturibution and importance
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
Sciences of Europe No 170 (2025)
Introduction to Cardiovascular system_structure and functions-1
Cell Membrane: Structure, Composition & Functions
Phytochemical Investigation of Miliusa longipes.pdf
Protein & Amino Acid Structures Levels of protein structure (primary, seconda...
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
AlphaEarth Foundations and the Satellite Embedding dataset
BIOMOLECULES PPT........................
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
Microbiology with diagram medical studies .pptx
HPLC-PPT.docx high performance liquid chromatography
2. Earth - The Living Planet Module 2ELS
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
Q1_LE_Mathematics 8_Lesson 5_Week 5.docx

Alias Calculus for a Simple Imperative Language with Decidable Pointer Arithmetic

  • 1. Alias Calculus for Simple Imperative Language with Decidable Pointer Arithmetic Aleksandr Vorontsov1, Aizhan Satekbayeva2, Nikolay Shilov3,4 М1Novosibirsk State University, Novosibirsk, Russia, 2 L.N. Gumilyov Eurasian National University, Astana, Kazakhstan, 3Nazarbayev University, Astana, Kazakhstan, 4A.P. Ershov Institute of Informatics Systems, Novosibirsk, Russia
  • 2. What is “Alias Calculus”? •Alias calculus was proposed by Bertrand Meyer in 2011 for a toy programming language with single data type for abstract pointers. •it is a set of syntax-driven rules to compute an upper approximation aft(S, P) for aliasing after execution of a program P for a given initial aliasing S. 14.11.2014 2 TMPA-2014: Alias Calculus
  • 3. What about this Research •Our current purpose is to present a variant of alias calculus for more realistic programming language with automatic and dynamic memory, with types for regular data as well as for decidable pointer arithmetic. 14.11.2014 3 TMPA-2014: Alias Calculus
  • 4. Why a new Research? •Aliasing problem is to predict, detect and/or trace pointers to the same addresses in dynamic memory. •Importance of the problem is due to mistakes and errors that may happen in program run- time due to improper alias handling. 14.11.2014 4 TMPA-2014: Alias Calculus
  • 5. Errors? •Below are two simple examples of errors (?) inC-like pseudo-code: •x = malloc(sizeof(int)); x = malloc(sizeof(int)); //memory leak; •y = x; free(x); free(y); // invalid access. 14.11.2014 5 TMPA-2014: Alias Calculus
  • 6. Alias Calculus for a Trivial Language •Bertrand Meyer: Steps Towards a Theory and Calculus of Aliasing. Int. J. of Software and Informatics (Festschrift in honor of Manfred Broy), 2011., p.77-115. 14.11.2014 6 TMPA-2014: Alias Calculus
  • 7. Sample Rules: memory dynamics •Memory deallocation and allocation operators have the same effect on alias relation because after these operations variable isn’t alias to any other variable: 14.11.2014 7 TMPA-2014: Alias Calculus
  • 8. Sample Rules: assignment •After assignment address variable forgets all its former aliases and becomes an alias to all aliases of the variable: 14.11.2014 8 TMPA-2014: Alias Calculus
  • 9. Sample Rules: assignment 14.11.2014 9 TMPA-2014: Alias Calculus x, y y, u x, z x, y x, y, u x:=y
  • 10. Sample Rules: compound programs •Sequential composition means sequential application: •Nondeterministic choice of any branch: 14.11.2014 TMPA-2014: Alias Calculus 10
  • 11. Towards More Realistic Language •Acronym MoRe stays for More Realistic programming language. •It has two data types that are called addresses and integers with implicit type casting in2ad from integers to addresses. 14.11.2014 TMPA-2014: Alias Calculus 11
  • 12. Addresses in MoRe •Address data type is any (finite or infinite) set of values ADR with constants denoted “0” and “1”, operations denoted “+” and “–” such that (ADR, 0, 1, +, –) is a commutative additive semi-group with decidable first-order theory TADR. 14.11.2014 TMPA-2014: Alias Calculus 12
  • 13. Examples of Legal Address Types •Zm, the ring of residuals modulo any particular fixed positive m, •Presburger arithmetic, etc. 14.11.2014 TMPA-2014: Alias Calculus 13
  • 14. Integers in MoRe •Integer data type in MoRe is any (finite or infinite) set of (mathematical) integers INT with standard constants 0 and 1, standard operations “+”, “–”, “*”, “/” and implicit computable surjective homomorphical type- casting function in2ad : (INT, 0, 1, +, –)  (ADR, 0, 1, +, –) . 14.11.2014 TMPA-2014: Alias Calculus 14
  • 15. MoRe Syntax 14.11.2014 TMPA-2014: Alias Calculus 15
  • 16. Structural Operational Semantics •MoRe SOS uses (memory) model consisting of two disjoint parts: a static memory (conventionally) called stack and dynamic memory (conventionally) called heap. 14.11.2014 TMPA-2014: Alias Calculus 16
  • 17. Structural Operational Semantics •State is a pair of mappings s=(st, hp) where •state of the stack st: V  INT is a partial mapping (with finite domain) from variables V to integers INT (understood as their values), •state of the heap hp: ADR  INT i.e. a partial mapping with finite domain from addresses ADR to integers INT (understood as referenced values). 14.11.2014 TMPA-2014: Alias Calculus 17
  • 18. Structural Operational Semantics •MoRe SOS is axiomatic system for triples s s where s is a state, s is a state or an exception abort, and  is a program. •Intuition behind this triple follows: program converts input state into output state (that may be exception). 14.11.2014 TMPA-2014: Alias Calculus 18
  • 19. Structural Operational Semantics •SOS inference rules are syntax-driven and have the following form: 14.11.2014 TMPA-2014: Alias Calculus 19
  • 20. Sample SOS Rule: static array in dynamic memory •If –xdom(st), –addresses in2ad(l), … in2ad(l+k) are disjoint, –in2ad(l), … in2ad(l+k)dom(hp) then 14.11.2014 TMPA-2014: Alias Calculus 20
  • 21. Alias Calculus for MoRe •A configuration is a quadruple Cnf=(I, A, S) consisting of –a sets of address variables, –a set of address expressions , –a finite set S of pairs of synonyms and antonyms (with variables in I) that has a solution as a system of equalities and inequalities in (ADR, 0, 1, +, –), i.e. that is consistent with theory TADR. 14.11.2014 TMPA-2014: Alias Calculus 21
  • 22. Alias Calculus for MoRe •Informally speaking in Cnf=(I, A, S) –the set I is for initialized address variables, –the set A is for address expressions that points onto allocated memory, –the set S is a system of equations and inequalities to specify what expressions may be aliases and what can’t be. 14.11.2014 TMPA-2014: Alias Calculus 22
  • 23. Sample Rule of Alias Calculus: assignment •Let Cnfx:=t be (Ix:=t , Ax:=t , Sx:=t) where 14.11.2014 TMPA-2014: Alias Calculus 23
  • 24. Main Result •The alias calculus for programming language MoRe is safe in the following sense: •Theorem: Let D be any alias distribution,  be any MoRe-program and s=(st, hp) be any state such that st╞D; if s=(st,hp) is a state such that s<>s then st╞aft(D,). 14.11.2014 TMPA-2014: Alias Calculus 24
  • 25. Conclusion •Equation based alias calculus for a model programming language with dynamic memory and decidable address arithmetic was developed. •The calculus can be used for control-flow insensitive safe alias analysis of MoRe programs but for practical applications the language must be much more realistic. 14.11.2014 TMPA-2014: Alias Calculus 25
  • 26. 14.11.2014 TMPA-2014: Alias Calculus 26 Thank You For Your Attention! Questions?