Patterns in OCL Burkhart Wolff Universit Paris-Sud - - PowerPoint PPT Presentation

patterns in ocl
SMART_READER_LITE
LIVE PREVIEW

Patterns in OCL Burkhart Wolff Universit Paris-Sud - - PowerPoint PPT Presentation

Patterns in OCL Burkhart Wolff Universit Paris-Sud Pattern-Matching Lambdas Proposal: Hidden second-order combinators, implicitly accepting a lambda buried under first-order notation, are: ->iterate ->exists ->forall


slide-1
SLIDE 1

Patterns in OCL

Burkhart Wolff

Université Paris-Sud

slide-2
SLIDE 2

System X, Project FSF, Internal Meeting 22.11.13 B.Wolff

Pattern-Matching Lambdas

  • Proposal:
  • Hidden second-order combinators, implicitly accepting a lambda buried

under first-order notation, are:

  • >iterate
  • >exists
  • >forall
  • >select
  • >collect
  • >any
  • >isUnique.

S->select(PATTERN | P x) for example: S->select(Seq{_, 3, a, …} | a >= 15)

  • r

S->select(Tuple{name=‘mueller', sex=male, age= x, …} | x >= 21)

slide-3
SLIDE 3

System X, Project FSF, Internal Meeting 22.11.13 B.Wolff

Pattern-Matching Lambdas

  • Proposal:
  • Hidden second-order combinators, implicitly accepting a lambda buried

under first-order notation, are:

for example S->select(Seq{_, 3, a, …} | a >= 15)

  • r

S->select(Tuple{name=‘mueller', sex=male, age= x, …} | x >= 21)

  • r

S->select(a in Employee | P a ) for

(S->select(a | a.oclIsKindOf(Employee) and P a ))

slide-4
SLIDE 4

System X, Project FSF, Internal Meeting 22.11.13 B.Wolff

Pattern-Matching Lambdas

  • Proposal:
  • Hidden second-order combinators, implicitly accepting a lambda buried

under first-order notation, are:

  • Possibility: implicit Tuple-notation for Classes:

class Employee is Person + salary : Integer[0..1] + department_id : Integer [1] end

Example:

  • S->select(Employee{salary = x, department_id=5, … }

| x <> null and x>2000 )