SlideShare a Scribd company logo
1 of 17
Download to read offline
Adding Random
Operations to OCL
Antonio Vallecillo,
Martin Gogolla
SEPTEMBER 19, 2017
Random in OCL
• Uncertainty is an essential element of
many of the systems we have to model
• Values of properties representing measures
• Decisions and branches
• Number of elements of populations
• Expected durations, costs, tolerance,…
• Random numbers and probability distributions can be of help here
• They permit combining definite knowledge at one level with uncertain values
• Expectations and assumptions that remain uncertain or imprecise at high-
level, can be made precise and realized by stating the corresponding
percentages or the probability distributions that parameters or values follow
2
Random in OCL
• Current OCL specification does not provide support for random
numbers or probability distributions
• Indeterminism only provided by “any()” operation on OCL Collections
11.9.1 Collection
any()
Returns any element in the source collection for which body evaluates to true.
Returns invalid if any body evaluates to invalid for any element, otherwise if
there are one or more elements for which body is true, an indeterminate
choice of one of them is returned, otherwise the result is invalid.
source->any(iterator | body) =
source->select(iterator | body)->asSequence()->first()
3
Indeterminism <> random
• This is the common behaviour of OCL “any()”
4
OCL random operations
context Real::rand() : Real
post undetermined:
if self > 0.0 then ( 0.0 <= result ) and ( result < self )
else if self < 0.0 then ( result <= 0.0 ) and ( self < result )
else result = self endif endif
post statisticallyRandom:
-- A sequence contains no recognizable patterns or regularities
-- This property deserves its own discussion :-)
context Integer::srnd() : Integer
post seedGeneration:
-- if self > 0 then self is the new seed
-- else a new seed is automatically generated (time, etc.)
-- in both cases it returns the previous seed
5
Some examples
6
Probability distributions
7
Some examples
8
Some examples
9
Generating random samples
10
Generating random samples
11
Implementation (1/2)
<operation source="Real" name="rand" returnType="Real">
<body>
<![CDATA[
$self * Random.rand
]]>
</body>
</operation>
<operation source="Integer" name="srand“ returnType="Integer">
<body>
<![CDATA[
if $self > 0 return Random.srand($self) % 1000000
else return Random.srand() % 10000000
end
]]>
</body>
</operation> 12
Implementation (2/2)
• Employing USE
extension mechanism
• Ruby implementation
of newly defined
operations
13
14
Conclusions
• Random numbers and Probability distributions permit dealing with
uncertainty at different levels
• Values of parameters and attributes
• Number of objects and links
• Size of test samples and values
• Beyond the basic indeterminism currently provided by OCL.
• Implementation available at
https://www.dropbox.com/s/2j9tgejbj507id0/oclextensions.zip?dl=0
15
Thanks!
Adding Random
Operations to OCL
Antonio Vallecillo,
Martin Gogolla
SEPTEMBER 19, 2017

More Related Content

Similar to Adding Random Operations to OCL

Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersUniversity of Huddersfield
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demoAjith Narayanan
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayTerrance Cohen
 
Functional Operations - Susan Potter
Functional Operations - Susan PotterFunctional Operations - Susan Potter
Functional Operations - Susan Potterdistributed matters
 
Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)kim.mens
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz
 
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...butest
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerAndrey Karpov
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#Rohit Rao
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Lionel Briand
 
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...huguk
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxssuserc074dd
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomizationNirav Desai
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheckBeScala
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAjith Narayanan
 
OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)Sung Kim
 

Similar to Adding Random Operations to OCL (20)

Two methods for optimising cognitive model parameters
Two methods for optimising cognitive model parametersTwo methods for optimising cognitive model parameters
Two methods for optimising cognitive model parameters
 
Oracle real application clusters system tests with demo
Oracle real application clusters system tests with demoOracle real application clusters system tests with demo
Oracle real application clusters system tests with demo
 
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance GameplayGDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
GDC 2010 - A Dynamic Component Architecture for High Performance Gameplay
 
Functional Operations - Susan Potter
Functional Operations - Susan PotterFunctional Operations - Susan Potter
Functional Operations - Susan Potter
 
Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)Mining source code for structural regularities (SATTOSE2010)
Mining source code for structural regularities (SATTOSE2010)
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
 
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
saihw1_weka_tutorial.pptx - Machine Discovery and Social Network ...
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzer
 
2. overview of c#
2. overview of c#2. overview of c#
2. overview of c#
 
Java Tutorial
Java Tutorial Java Tutorial
Java Tutorial
 
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
Efficient Online Testing for DNN-Enabled Systems using Surrogate-Assisted and...
 
STL Algorithms In Action
STL Algorithms In ActionSTL Algorithms In Action
STL Algorithms In Action
 
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
Sean Kandel - Data profiling: Assessing the overall content and quality of a ...
 
ObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptxObjRecog2-17 (1).pptx
ObjRecog2-17 (1).pptx
 
ppt.pptx
ppt.pptxppt.pptx
ppt.pptx
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
cb streams - gavin pickin
cb streams - gavin pickincb streams - gavin pickin
cb streams - gavin pickin
 
An introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methodsAn introduction to_rac_system_test_planning_methods
An introduction to_rac_system_test_planning_methods
 
OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)OCAT: Object Capture based Automated Testing (ISSTA 2010)
OCAT: Object Capture based Automated Testing (ISSTA 2010)
 

More from Antonio Vallecillo

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsAntonio Vallecillo
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsAntonio Vallecillo
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsAntonio Vallecillo
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLAntonio Vallecillo
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyAntonio Vallecillo
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainAntonio Vallecillo
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software ModelsAntonio Vallecillo
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationAntonio Vallecillo
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringAntonio Vallecillo
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...Antonio Vallecillo
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoAntonio Vallecillo
 
La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesAntonio Vallecillo
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaAntonio Vallecillo
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...Antonio Vallecillo
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...Antonio Vallecillo
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...Antonio Vallecillo
 
Accountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAccountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAntonio Vallecillo
 
Improving Naming and Grouping in UML
Improving Naming and Grouping in UMLImproving Naming and Grouping in UML
Improving Naming and Grouping in UMLAntonio Vallecillo
 
On the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesOn the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesAntonio Vallecillo
 

More from Antonio Vallecillo (20)

Modeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain BehaviorsModeling Objects with Uncertain Behaviors
Modeling Objects with Uncertain Behaviors
 
Introducing Subjective Knowledge Graphs
Introducing Subjective Knowledge GraphsIntroducing Subjective Knowledge Graphs
Introducing Subjective Knowledge Graphs
 
Using UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital TwinsUsing UML and OCL Models to realize High-Level Digital Twins
Using UML and OCL Models to realize High-Level Digital Twins
 
Modeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCLModeling behavioral deontic constraints using UML and OCL
Modeling behavioral deontic constraints using UML and OCL
 
Modeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of UncertaintyModeling and Evaluating Quality in the Presence of Uncertainty
Modeling and Evaluating Quality in the Presence of Uncertainty
 
Research Evaluation - The current situation in Spain
Research Evaluation - The current situation in SpainResearch Evaluation - The current situation in Spain
Research Evaluation - The current situation in Spain
 
Belief Uncertainty in Software Models
Belief Uncertainty in Software ModelsBelief Uncertainty in Software Models
Belief Uncertainty in Software Models
 
Extending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured InformationExtending Complex Event Processing to Graph-structured Information
Extending Complex Event Processing to Graph-structured Information
 
Towards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software EngineeringTowards a Body of Knowledge for Model-Based Software Engineering
Towards a Body of Knowledge for Model-Based Software Engineering
 
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
La Ingeniería Informática no es una Ciencia -- Reflexiones sobre la Educación...
 
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código ÉticoLa Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
La Ética en la Ingeniería de Software de Pruebas: Necesidad de un Código Ético
 
La ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidadesLa ingeniería del software en España: retos y oportunidades
La ingeniería del software en España: retos y oportunidades
 
Los Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de MálagaLos Estudios de Posgrado de la Universidad de Málaga
Los Estudios de Posgrado de la Universidad de Málaga
 
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
El papel de los MOOCs en la Formación de Posgrado. El reto de la Universidad...
 
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
La enseñanza digital y los MOOC en la UMA. Presentación en el XV encuentro de...
 
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
El doctorado en Informática: ¿Nuevo vino en viejas botellas? (Charla U. Sevil...
 
Accountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed SystemsAccountable objects: Modeling Liability in Open Distributed Systems
Accountable objects: Modeling Liability in Open Distributed Systems
 
Models And Meanings
Models And MeaningsModels And Meanings
Models And Meanings
 
Improving Naming and Grouping in UML
Improving Naming and Grouping in UMLImproving Naming and Grouping in UML
Improving Naming and Grouping in UML
 
On the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling LanguagesOn the Combination of Domain Specific Modeling Languages
On the Combination of Domain Specific Modeling Languages
 

Recently uploaded

%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 

Adding Random Operations to OCL

  • 1. Adding Random Operations to OCL Antonio Vallecillo, Martin Gogolla SEPTEMBER 19, 2017
  • 2. Random in OCL • Uncertainty is an essential element of many of the systems we have to model • Values of properties representing measures • Decisions and branches • Number of elements of populations • Expected durations, costs, tolerance,… • Random numbers and probability distributions can be of help here • They permit combining definite knowledge at one level with uncertain values • Expectations and assumptions that remain uncertain or imprecise at high- level, can be made precise and realized by stating the corresponding percentages or the probability distributions that parameters or values follow 2
  • 3. Random in OCL • Current OCL specification does not provide support for random numbers or probability distributions • Indeterminism only provided by “any()” operation on OCL Collections 11.9.1 Collection any() Returns any element in the source collection for which body evaluates to true. Returns invalid if any body evaluates to invalid for any element, otherwise if there are one or more elements for which body is true, an indeterminate choice of one of them is returned, otherwise the result is invalid. source->any(iterator | body) = source->select(iterator | body)->asSequence()->first() 3
  • 4. Indeterminism <> random • This is the common behaviour of OCL “any()” 4
  • 5. OCL random operations context Real::rand() : Real post undetermined: if self > 0.0 then ( 0.0 <= result ) and ( result < self ) else if self < 0.0 then ( result <= 0.0 ) and ( self < result ) else result = self endif endif post statisticallyRandom: -- A sequence contains no recognizable patterns or regularities -- This property deserves its own discussion :-) context Integer::srnd() : Integer post seedGeneration: -- if self > 0 then self is the new seed -- else a new seed is automatically generated (time, etc.) -- in both cases it returns the previous seed 5
  • 12. Implementation (1/2) <operation source="Real" name="rand" returnType="Real"> <body> <![CDATA[ $self * Random.rand ]]> </body> </operation> <operation source="Integer" name="srand“ returnType="Integer"> <body> <![CDATA[ if $self > 0 return Random.srand($self) % 1000000 else return Random.srand() % 10000000 end ]]> </body> </operation> 12
  • 13. Implementation (2/2) • Employing USE extension mechanism • Ruby implementation of newly defined operations 13
  • 14. 14
  • 15. Conclusions • Random numbers and Probability distributions permit dealing with uncertainty at different levels • Values of parameters and attributes • Number of objects and links • Size of test samples and values • Beyond the basic indeterminism currently provided by OCL. • Implementation available at https://www.dropbox.com/s/2j9tgejbj507id0/oclextensions.zip?dl=0 15
  • 17. Adding Random Operations to OCL Antonio Vallecillo, Martin Gogolla SEPTEMBER 19, 2017