Traversal of Object Structures - PowerPoint PPT Presentation

About This Presentation
Title:

Traversal of Object Structures

Description:

Informally, a traversal is a (possibly infinite) set of concrete ... Judge(O,o,R,epsilon) if tail(R,Class(o))={} where epsilon denotes the empty history, and ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 7
Provided by: karljlie
Category:

less

Transcript and Presenter's Notes

Title: Traversal of Object Structures


1
Traversal of Object Structures
  • Karl Lieberherr

2
Definition of traversals
  • Traversals of object graphs.
  • Informally, a traversal is a (possibly infinite)
    set of concrete class graph paths when used in
    conjunction with an object graph, it results in a
    sequence of objects, called the traversal
    history.
  • The traversal history is a depth-first traversal
    of the object graph along object paths agreeing
    with the given concrete path set.

3
Definition of Traversals
  • For a set of sequences R subset of S for an
    alphabet S, define
  • head(R) x in S exists a.(xa in R)
  • tail(R,x) a xa in R for some x in S .
  • Intuitively, head(R) is the set of all first
    elements of R, and tail(R,x) is the set of all
    tails'' of sequences of R that start with x
    (where a tail of a sequence is the whole sequence
    except its first element).

4
Definition of Traversals
  • Fix a class graph G. If O is an acyclic object
    graph which is an instance of G, o an object in
    O, R a set of concrete paths corresponding to
    paths of G, and H a sequence of objects, then the
    judgment Judge(O,o,R,H) means that when
    traversing the object graph O starting with o,
    and guided by the concrete path set R, then H is
    the traversal history. This judgment holds when
    it is derivable using the following rules

5
Definition of Traversals
  • -----------------------------------------------
  • Judge(O,o,R,epsilon)
  • if tail(R,Class(o)) where epsilon denotes the
    empty history, and
  • Judge(O, o_i, tail(tail(R,Class(o)),l_i),H_i)
    forall i in 1..n
  • --------------------------------------------------
    -------------------------------
  • O \vdash_s o R \rhd o H_1 ... H_n
  • Judge(O, o, R, H_1 ... H_n
  • if head(tail(R,Class(o))) l_i i in 1..n,
  • edge o l_i o_i is in O, i in 1..n, and
  • l_j lt l_k for 1 lt j lt k lt n.

6
Discussion of semantics
  • R may be an infinite set, so semantics does not
    immediately provide an interpreter.
  • What we need for an interpreter is a finite
    representation of R
Write a Comment
User Comments (0)
About PowerShow.com