A parallel pebble game with applications to expression evaluation - PowerPoint PPT Presentation

About This Presentation
Title:

A parallel pebble game with applications to expression evaluation

Description:

... pebble game with applications to expression evaluation. Lecture 11. Parallel pebble game ... At the outset of the game only the leaves of the tree are pebbled. ... – PowerPoint PPT presentation

Number of Views:76
Avg rating:3.0/5.0
Slides: 10
Provided by: IgorPo
Category:

less

Transcript and Presenter's Notes

Title: A parallel pebble game with applications to expression evaluation


1
A parallel pebble game with applications to
expression evaluation
  • Lecture 11

2
Parallel pebble game on binary tree
  • Within the game each node v of the tree has
    associated with it similar node denoted by
    cond(v).
  • At the outset of the game cond(v)v, for all v
  • During the game the pairs (v,cond(v)) can be
    thought of as additional edges
  • Node v is active if and only if cond(v)?v

3
Pebbling
  • Pebbling a node denotes the fact that in the
    current state of the game the processor
    associated with that node has sufficient
    information to evaluate the subtree rooted here

4
Three operationsactive, square and pebble
  • Activate
  • for all non-leaf nodes v in parallel do
  • if v is not active and precisely one of its
    sons is pebbled then
  • cond(v) becomes the other son
  • if v is not active and both sons are pebbled
    then
  • cond(v) becomes one of the sons arbitrarily
  • Square
  • for all nodes v in parallel do cond(v)?
    cond(cond(v))
  • Pebble
  • for all nodes v in parallel do
  • if cond(v) is pebbled then pebble v

5
Key result
  • At the outset of the game only the leaves of the
    tree are pebbled.
  • One composite move of the pebbling game is the
    sequence of individual operations
  • (activate, square, square, pebble)
  • Theorem
  • Let T be a binary tree with n leaves. If
    initially only the leaves are pebbled then after
    log2n moves of the pebbling game the root of T
    becomes pebbled.

6
Example
square
activate
square
pebbling
7
The application of the pebbling game
  • Consider the arithmetic expression
    ((3(22))35)
  • We assign a processor to each non-leaf node of
    the tree.

8
X5
X3
X3
X2
3x5
3(2x3)5
3x9
3(2x)9
2x3
2x3
2x
2x
9
Evaluation of arithmetic expressions
  • Arithmetic expressions can be evaluated on a
    PRAM in O(log n) time using O(n) processors.
Write a Comment
User Comments (0)
About PowerShow.com