SlideShare a Scribd company logo
1 of 17
Towards Sliced Alloy
Vajih Montaghami
University of Waterloo
Program slicing
• Program Slicing: Automatically decompose
program by analyzing their data flow, control
flow, and graph dependency
• Comprehend slice: debugging, testing
• Comprehend slices: parallelization
• Alloy is a logic specification language
• Slicing based on the Alloy type-system.
2
Example for an Imperative
Language
3
for(i=0...9) x++
for(i=0..3) y++
v=x
w=y
for(i=0...9) x++
v=x
for(i=0..3) y++
w=y
Example for an Imperative
Language
4
for(i=0...9) x++
for(i=0..3) y++
v=x
w=y
for(i=0...9) x++
v=x
for(i=0..3) y++
w=y
for(i=0...9) x++
for(i=0..x) y++
v=x
w=y
for(i=0...9) x++
v=x
for(i=0..x) y++
w=y
Serial
Poker: a motivating example
5
sig Suit{}
sig Number{gt:lone Number}
sig Card{suit: one Suit,
number: one Number}
fact Card_Set{
all disjoint c1,c2:Card|
c1.number!=c2.number and
c1.suit !=c2.suit
--card set does not include Joker
all c: Card | c.number != Joker
}
There are 56 Possible Cards, but 52 Cards are Valid.
Poker: a motivation example
6
fact playing_rules{
--Nobody plays by himself
all p:Player | p.successor != p
--Playing in a circular order
all p:Player | p.^successor = Player
--each player have exactly two cards
all p:Player | #p.cards = 2
--Pocket cards are not shared
all disjoint p1,p2:Player | no (p1.cards & p2.cards )
}
sig Player{
cards: set Card,
chips: one Int,
successor: one Player}
sig Suit{}
sig Number{gt:lone Number}
sig Card{suit: one Suit,
number: one Number}
fact Card_Set{
all disjoint c1,c2:Card |
c1.number=c2.number and c1.suit =c2.suit
--card set does not include Joker
all c: Card | c.number != Joker
}
Idea
• Preventing exponential growing of the state
space.
• Alloy creates an upper bound for solution
• Solve smaller slices such that
8
Σcost(slicei) ≪cost(whole)
cost: Memory+Time
Approach
• Which part of possible instances should be
generated first?
• Which part of a model can be solved first?
9
Slicing Signatures
• A sig depends on another sig if:
• declares a relation, e.g.:
• sig A{} sig B{r:A}
• extends another sig, e.g. :
• sig B extends A{}
• sig B in A{}
• If B depends on A, then generating instances
of B requires the existence of instances of A.
10
Dependency Graph
• Dependency class: All sigs that does not have
input edge in the dependency graph
• Remove all dependent sigs from the dependency
graph and find other dependent sigs
• A dependency class
• Depends on predecessors
• Not depend on successors
11
Example of Dependency Graph
12
The most
independent class
The most
dependent class
Predicates slicing
• Find a predicates such that:
• The instances of relations in the predicate is
already in a sig class and its predecessors.
• Example:
13
--No Joker in Deck
all c: Card | c.number != Joker
Card.(Card->Number) != Number
Challenge to Slice predicates
• Relation overloading
• Two relation defined in two signatures with the
same name
• Over-approximates the denoted Signatures.
• The resolution depends on the context
14
Alloy type system
15
• Relation overloading
• Example
sig Player{
cards: set Card,
chips: one Int,
successor: one Player}
sig Round{
cards: set Card,
dealer: one Player,
blind: one Player}
Player.(cards+cards) = 2
Player.(Player→Card+Round→Ca
rd)
{Player,Card,Round}SigIn(φ) =
φ :
Handling overloading
• Reusing Alloy type system
• Runs in two opposite way
• Bottom-up: Approximates the relations that
might belong to expression
• Top-down: Approximates the portion of
relations that are relevant to context
16
Feasibility Study
• One model has been tested so far
• Simon: Software design modularity Analysis
19
Total
Variables
Primary
Variables
Clauses
Translation
time (ms)
Solving
time (ms)
A4.2 59,953 768 162,417 11,188 27,730
A4.2p 59,694 773 162,642 12,742 6,744
A4.2s2 20,060 503 37,148 986 2,174
A4.2s1 22 8 25 30 40
A4.2sT 20,082 511 37,173 1016 2,214
Conclusion
• Alloy is not imperative, but we still need
Static Analyzer
• Typed-system
• Optimizer Execution
• Slicing does always improve performance
• More benchmarking
20

More Related Content

Viewers also liked

Think globally
Think globallyThink globally
Think globallypinkkiss14
 
El motor 4 a
El motor 4 aEl motor 4 a
El motor 4 aMel15X
 
Pluri Consultoria - Estaduais 2013
Pluri Consultoria - Estaduais 2013Pluri Consultoria - Estaduais 2013
Pluri Consultoria - Estaduais 2013Portal NE10
 
Manejo de los medios de comunicación
Manejo de los medios de comunicaciónManejo de los medios de comunicación
Manejo de los medios de comunicaciónPiero Termini
 
Writing for the New Digital Media
Writing for the New Digital MediaWriting for the New Digital Media
Writing for the New Digital MediaMeredith Gould
 
Fons de mey smart mobility technology view
Fons de mey smart mobility technology viewFons de mey smart mobility technology view
Fons de mey smart mobility technology viewAgoria
 
Tic project
Tic projectTic project
Tic projectjosrdg
 

Viewers also liked (8)

Ada #6 (2)
Ada #6 (2)Ada #6 (2)
Ada #6 (2)
 
Think globally
Think globallyThink globally
Think globally
 
El motor 4 a
El motor 4 aEl motor 4 a
El motor 4 a
 
Pluri Consultoria - Estaduais 2013
Pluri Consultoria - Estaduais 2013Pluri Consultoria - Estaduais 2013
Pluri Consultoria - Estaduais 2013
 
Manejo de los medios de comunicación
Manejo de los medios de comunicaciónManejo de los medios de comunicación
Manejo de los medios de comunicación
 
Writing for the New Digital Media
Writing for the New Digital MediaWriting for the New Digital Media
Writing for the New Digital Media
 
Fons de mey smart mobility technology view
Fons de mey smart mobility technology viewFons de mey smart mobility technology view
Fons de mey smart mobility technology view
 
Tic project
Tic projectTic project
Tic project
 

Similar to Sliced Alloy

Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBMongoDB
 
Follow the money with graphs
Follow the money with graphsFollow the money with graphs
Follow the money with graphsStanka Dalekova
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming LanguageSteve Johnson
 
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
Data Base Management system relation algebra ER diageam Sql Query -nested  qu...Data Base Management system relation algebra ER diageam Sql Query -nested  qu...
Data Base Management system relation algebra ER diageam Sql Query -nested qu...kudiyarc
 
Graph Sample and Hold: A Framework for Big Graph Analytics
Graph Sample and Hold: A Framework for Big Graph AnalyticsGraph Sample and Hold: A Framework for Big Graph Analytics
Graph Sample and Hold: A Framework for Big Graph AnalyticsNesreen K. Ahmed
 
The dag representation of basic blocks
The dag representation of basic blocksThe dag representation of basic blocks
The dag representation of basic blocksShabeen Taj
 
Optimizing the Catalyst Optimizer for Complex Plans
Optimizing the Catalyst Optimizer for Complex PlansOptimizing the Catalyst Optimizer for Complex Plans
Optimizing the Catalyst Optimizer for Complex PlansDatabricks
 
Mit6 087 iap10_lec02
Mit6 087 iap10_lec02Mit6 087 iap10_lec02
Mit6 087 iap10_lec02John Lawrence
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesMax De Marzi
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleChristophe Grand
 
Challenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkChallenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkDatabricks
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengChallenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengDatabricks
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingNesreen K. Ahmed
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryStanka Dalekova
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryStanka Dalekova
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Databricks
 

Similar to Sliced Alloy (20)

Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDB
 
Sql server select queries ppt 18
Sql server select queries ppt 18Sql server select queries ppt 18
Sql server select queries ppt 18
 
Follow the money with graphs
Follow the money with graphsFollow the money with graphs
Follow the money with graphs
 
Learn c++ Programming Language
Learn c++ Programming LanguageLearn c++ Programming Language
Learn c++ Programming Language
 
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
Data Base Management system relation algebra ER diageam Sql Query -nested  qu...Data Base Management system relation algebra ER diageam Sql Query -nested  qu...
Data Base Management system relation algebra ER diageam Sql Query -nested qu...
 
Graph Sample and Hold: A Framework for Big Graph Analytics
Graph Sample and Hold: A Framework for Big Graph AnalyticsGraph Sample and Hold: A Framework for Big Graph Analytics
Graph Sample and Hold: A Framework for Big Graph Analytics
 
Bill howe 8_graphs
Bill howe 8_graphsBill howe 8_graphs
Bill howe 8_graphs
 
The dag representation of basic blocks
The dag representation of basic blocksThe dag representation of basic blocks
The dag representation of basic blocks
 
Optimizing the Catalyst Optimizer for Complex Plans
Optimizing the Catalyst Optimizer for Complex PlansOptimizing the Catalyst Optimizer for Complex Plans
Optimizing the Catalyst Optimizer for Complex Plans
 
Mit6 087 iap10_lec02
Mit6 087 iap10_lec02Mit6 087 iap10_lec02
Mit6 087 iap10_lec02
 
Outrageous Ideas for Graph Databases
Outrageous Ideas for Graph DatabasesOutrageous Ideas for Graph Databases
Outrageous Ideas for Graph Databases
 
FP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit HoleFP Days: Down the Clojure Rabbit Hole
FP Days: Down the Clojure Rabbit Hole
 
Challenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache SparkChallenging Web-Scale Graph Analytics with Apache Spark
Challenging Web-Scale Graph Analytics with Apache Spark
 
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui MengChallenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
Challenging Web-Scale Graph Analytics with Apache Spark with Xiangrui Meng
 
High-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and ModelingHigh-Performance Graph Analysis and Modeling
High-Performance Graph Analysis and Modeling
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
 
Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™Web-Scale Graph Analytics with Apache® Spark™
Web-Scale Graph Analytics with Apache® Spark™
 
Realtime Analytics
Realtime AnalyticsRealtime Analytics
Realtime Analytics
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

Sliced Alloy

  • 1. Towards Sliced Alloy Vajih Montaghami University of Waterloo
  • 2. Program slicing • Program Slicing: Automatically decompose program by analyzing their data flow, control flow, and graph dependency • Comprehend slice: debugging, testing • Comprehend slices: parallelization • Alloy is a logic specification language • Slicing based on the Alloy type-system. 2
  • 3. Example for an Imperative Language 3 for(i=0...9) x++ for(i=0..3) y++ v=x w=y for(i=0...9) x++ v=x for(i=0..3) y++ w=y
  • 4. Example for an Imperative Language 4 for(i=0...9) x++ for(i=0..3) y++ v=x w=y for(i=0...9) x++ v=x for(i=0..3) y++ w=y for(i=0...9) x++ for(i=0..x) y++ v=x w=y for(i=0...9) x++ v=x for(i=0..x) y++ w=y Serial
  • 5. Poker: a motivating example 5 sig Suit{} sig Number{gt:lone Number} sig Card{suit: one Suit, number: one Number} fact Card_Set{ all disjoint c1,c2:Card| c1.number!=c2.number and c1.suit !=c2.suit --card set does not include Joker all c: Card | c.number != Joker } There are 56 Possible Cards, but 52 Cards are Valid.
  • 6. Poker: a motivation example 6 fact playing_rules{ --Nobody plays by himself all p:Player | p.successor != p --Playing in a circular order all p:Player | p.^successor = Player --each player have exactly two cards all p:Player | #p.cards = 2 --Pocket cards are not shared all disjoint p1,p2:Player | no (p1.cards & p2.cards ) } sig Player{ cards: set Card, chips: one Int, successor: one Player} sig Suit{} sig Number{gt:lone Number} sig Card{suit: one Suit, number: one Number} fact Card_Set{ all disjoint c1,c2:Card | c1.number=c2.number and c1.suit =c2.suit --card set does not include Joker all c: Card | c.number != Joker }
  • 7. Idea • Preventing exponential growing of the state space. • Alloy creates an upper bound for solution • Solve smaller slices such that 8 Σcost(slicei) ≪cost(whole) cost: Memory+Time
  • 8. Approach • Which part of possible instances should be generated first? • Which part of a model can be solved first? 9
  • 9. Slicing Signatures • A sig depends on another sig if: • declares a relation, e.g.: • sig A{} sig B{r:A} • extends another sig, e.g. : • sig B extends A{} • sig B in A{} • If B depends on A, then generating instances of B requires the existence of instances of A. 10
  • 10. Dependency Graph • Dependency class: All sigs that does not have input edge in the dependency graph • Remove all dependent sigs from the dependency graph and find other dependent sigs • A dependency class • Depends on predecessors • Not depend on successors 11
  • 11. Example of Dependency Graph 12 The most independent class The most dependent class
  • 12. Predicates slicing • Find a predicates such that: • The instances of relations in the predicate is already in a sig class and its predecessors. • Example: 13 --No Joker in Deck all c: Card | c.number != Joker Card.(Card->Number) != Number
  • 13. Challenge to Slice predicates • Relation overloading • Two relation defined in two signatures with the same name • Over-approximates the denoted Signatures. • The resolution depends on the context 14
  • 14. Alloy type system 15 • Relation overloading • Example sig Player{ cards: set Card, chips: one Int, successor: one Player} sig Round{ cards: set Card, dealer: one Player, blind: one Player} Player.(cards+cards) = 2 Player.(Player→Card+Round→Ca rd) {Player,Card,Round}SigIn(φ) = φ :
  • 15. Handling overloading • Reusing Alloy type system • Runs in two opposite way • Bottom-up: Approximates the relations that might belong to expression • Top-down: Approximates the portion of relations that are relevant to context 16
  • 16. Feasibility Study • One model has been tested so far • Simon: Software design modularity Analysis 19 Total Variables Primary Variables Clauses Translation time (ms) Solving time (ms) A4.2 59,953 768 162,417 11,188 27,730 A4.2p 59,694 773 162,642 12,742 6,744 A4.2s2 20,060 503 37,148 986 2,174 A4.2s1 22 8 25 30 40 A4.2sT 20,082 511 37,173 1016 2,214
  • 17. Conclusion • Alloy is not imperative, but we still need Static Analyzer • Typed-system • Optimizer Execution • Slicing does always improve performance • More benchmarking 20

Editor's Notes

  1. Introduce Sig as Class
  2. Even worse if we have subetyping