Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification...
-
date post
19-Dec-2015 -
Category
Documents
-
view
215 -
download
2
Transcript of Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification...
Knowledge and Systems Research Group, University of Huddersfield
B vs OCL: Comparing Specification Languages for
Planning DomainsDiane Kitchin, Lee McCluskey, Margaret West
TALK to be given by: Ron Simpson
Knowledge and Software Systems
Research Group,
The University of Huddersfield
Knowledge and Systems Research Group, University of Huddersfield
Formal Software Specification Languages
Artificial Intelligence Planning Domain Model Languages
Process/ Systems/ Requirements Modelling Languages
CSP
Petri Nets
Z
BVDMUML
SSADM
PDDL OCLh
Declarative/ Descriptive Languages
SE
AI
Knowledge and Systems Research Group, University of Huddersfield
Formal Specification Languages (eg B) are ‘close’ to Planning Domain Model Languages (eg OCLh)
They share: the concept of a `state' the technique of using pre and post conditions in
state transformation, via operations to specify state dynamics
the assumptions of closed world, default persistence and instantaneous operator execution
the presence of state invariants for validity and documentation purposes.
Knowledge and Systems Research Group, University of Huddersfield
Capturing domain knowledge very accurately.. the need:
Real Planning Applications now exist in safety-related areas:
Space mission control Military resource control Robot control
- among many other implications (!) there is a need to establish and maintain highly accurate domain knowledge
Knowledge and Systems Research Group, University of Huddersfield
Accurate domain knowledge.. How? Our current method using GIPO:
Knowledge Sources
Operational Domain Model
Knowledge Formulation
Validation Processes
GIPOOCLh
Knowledge and Systems Research Group, University of Huddersfield
Accurate domain knowledge.. How? Method using a FSL:
Knowledge Sources
Formal Specification
Operational Domain Model
Knowledge Formulation
Validation and Translation
Knowledge and Systems Research Group, University of Huddersfield
Accurate domain knowledge.. How? FSL = ‘B’, Tool = B-Toolkit
Knowledge Sources
Formal Specification
Operational Domain Model
Knowledge Formulation
Validation and Translation
‘BToolkit’B
Knowledge and Systems Research Group, University of Huddersfield
Paper content: Compare GIPO to B-Toolkit (OCLh vs B)
Both GIPO and B-Toolkit are tools environments that provide tools for the capture and debugging of formal models
The B method is of industrial-strength and while the B-Toolkit is commercially available, GIPO is a research tool
Knowledge and Systems Research Group, University of Huddersfield
Simple Comparison Method
Take some typical worlds which have been represented in OCLh using GIPO (Blocks World, Tyre World).
Re-formulate them using the B-Toolkit. Compare the Process and Result of the
formulation.
Knowledge and Systems Research Group, University of Huddersfield
Domain Model Formulation in OCLh : GIPO
. GIPO contains domain model editors basic static analysis checking tools.
is object class hierarchy consistent?do object state descriptions satisfy invariants?are predicate structures and operator schema mutually consistent?are task specifications consistent with the domain model?
a plan stepper a reachability analyser solution animator a random task generator hierarchy consistency check operator learning mechanism
Acquisition of Objects/Classes /Invariants
Operator Acquisition
Static Analysis Tools
More Static Analysis
Solving simple tasks using The Plan Stepper
Solving more complexTasks with Planners
Knowledge and Systems Research Group, University of Huddersfield
GIPO’s GUI
Knowledge and Systems Research Group, University of Huddersfield
Domain Model Formulation in B: B-Toolkit
Define a set of abstract machines To define each machine, define its variables, its
invariant, its initialisation and operations
e.g.
MACHINE: Blocks_World
SETS: Block, Gripper
VARIABLES: On_Block, On_Table, Gripped, Free
Knowledge and Systems Research Group, University of Huddersfield
B-Toolkit Animator
Knowledge and Systems Research Group, University of Huddersfield
Domain Model Formulation in B: Language Comparison
OCL B
Primitive sorts Sets
Predicate Names Variable Names
Operator Schema Operations
Properties Boolean-valuesFunctions
Predicates(X,Y) Relationsbetween X and Y
Knowledge and Systems Research Group, University of Huddersfield
Domain Model Formulation in B: B-Toolkit
Generate and Discharge ‘Proof Obligations’
A set of proof obligations involving consistency properties of a system can be automatically generated by the B-Tool. e.g.:
(1) Consistency of initialisation: the initialisation must establish the invariant.
(2) Consistency of operation: each operation must preserve the invariant.
Execute (Animate) Operations
Knowledge and Systems Research Group, University of Huddersfield
Knowledge and Systems Research Group, University of Huddersfield
Knowledge and Systems Research Group, University of Huddersfield
Knowledge and Systems Research Group, University of Huddersfield
Discharged Proof Obligation
Knowledge and Systems Research Group, University of Huddersfield
General Results - 1 B allows the user to encode more precise details about
the relations in the domain than GIPO - they can be relations, 1-1 functions etc, and can be given accurate restrictions. This level of precision is certainly not available in most planning languages, and is attractive in safety-related applications.
As OCLh is aimed specifically at planning, it has in-built structures and mechanisms that anticipate the entities that are to be represented. This makes the encoding rather more compact than the B specification.
Encoding in B, as one would expect from a general language, one is left with more choices and decisions in the encoding process.
Knowledge and Systems Research Group, University of Huddersfield
General Results -2
Both languages assume default persistence and a closed world. The differences in this respect are subtle, in that in B a variable involved in a precondition remains unaltered by default. However in OCLh there is a local open-world assumption in operator descriptions - a `prevail' is required if precondition variables are unchanged.
Regarding validation and debugging, both GIPO and the B-Toolkit provide effective, automated tool support which performs validation/consistency checks and identifies the presence of bugs. Not surprisingly, the B-Toolkit was more reliable at finding inconsistencies in some cases, as it demands a more detailed specification, and the tool is more developed.
Knowledge and Systems Research Group, University of Huddersfield
ConclusionsThe comparison shows a remarkable similarity between the two languages
and tool functions. The advantages in using a method such as B are that
- it is mathematically based so that formal reasoning can be used to deduce desirable (and potentially undesirable) properties.
- support for the method is available via tools - such as the Toolkit.
However, the disadvantages are that
- there are no special planning - oriented features,
- the B specification, once validated, would have to be translated into a more planner-friendly language in order to be used with current planning engines.
FUTURE WORK:
- build a B -> OCL translator
- try out B on a complex planning world