Visual Programming Languages ICS 519 Paradigms - PowerPoint PPT Presentation

About This Presentation
Title:

Visual Programming Languages ICS 519 Paradigms

Description:

The features (Von Neumann architecture) are: Variables ... in Dataflow Programming Language', ACM Computing Survey, Vol. 36, No. 1, March 2004, pp.1-34. ... – PowerPoint PPT presentation

Number of Views:22
Avg rating:3.0/5.0
Slides: 24
Provided by: facultyK
Category:

less

Transcript and Presenter's Notes

Title: Visual Programming Languages ICS 519 Paradigms


1
Visual Programming LanguagesICS 519Paradigms
  • ICS Department
  • KFUPM
  • Feb. 1, 2005

2
Paradigms
  • Imperative Languages
  • The features (Von Neumann architecture) are
  • Variables
  • Assignment

















  • Control Structures

3
Textual Example
  • main()
  • int i
  • for ( i0 ilt10 i)
  • printf(" d\n " , i)

4
Visual Example
  • Pascal-BLOX Language

5
  • 2) Functional (Applicative) Languages
  • Function
  • Atom
  • List
  • Recursion

6
Textual Example
  • (DEFINE (equal list1 list2)
  • (COND
  • ((ATOM? list1) (EQ? list1 list2))
  • ((ATOM? List2) NIL)
  • ((equal (CAR list1) (CAR list2))
  • (equal (CDR list1) (CDR list2)))
  • (ELSE NIL)
  • ))

7
Visual Example
  • Clarity Language

8
  • 3) Object Oriented
  • Class
  • Object
  • Message passing

9
Textual Example
  • 5 - 3
  • 2
  • (3lt5) ifTrue 17
  • 17
  • i ? 2
  • ilt9whileTruei print. i ? i 3
  • 2
  • 5
  • 8

10
Visual Example
  • Prograph is an example of a visual OOLs.
  • It has a visual representation for the following
    OOP concepts
  • Classes
  • Methods
  • Parallelism
  • Sequencing
  • Iteration
  • Conditional
  • Look at the next figure.

11
  • Prograph Language

12
  • 4) Logic languages
  • list
  • predicate
  • rule
  • goal

13
Example
  • parent(X, Y) - mother(X, Y).
  • parent(X, Y) - father(X, Y).
  • grandparent(X, Z) - parent(X, Y),parent(Y, Z).
  • parent(ali, ahmd).
  • parent(mohmd, ali).
  • grandparent(ahmd)

14
Visual Example
  • Logic Languages
  • Variable
  • Constant

15
  • Predicate
  • q()
  • q(x) q(a,b)

q
q
q
a
b
16
  • Rule
  • person(x)-mother(x,y),father(x,y)

person
mother
father
17
  • program

person
person
ali
person
Mother
Father
18
  • 5) Dataflow Languages
  • Programs are represented by a directed graph.
  • Nodes
  • Arcs
  • Johnston, Hanna, and Millar, Advances in
    Dataflow Programming Language, ACM Computing
    Survey, Vol. 36, No. 1, March 2004, pp.1-34.

19
Pure Dataflow Model
  • Programs are represented by a directed graph.
  • Nodes are primitive instructions such as
    arithmetic and comparison operations.
  • Arcs represent the data dependencies between the
    instructions.
  • Conceptually, data flows as tokens along the arcs
    which behave like unbounded first-in, first-out
    (FIFO) queues.
  • Arcs that flow toward a node are said to be input
    arcs to that node, while those that flow away are
    said to be output arcs from that node.

20
Pure Dataflow Model (Continue)
  • When the program begins, special activation nodes
    place data onto certain key input arcs,
    triggering the rest of the program.
  • Whenever a specific set of input arcs of a node
    (called a firing set) has data on it, the node is
    said to be fireable.
  • A fireable node is executed at some undefined
    time after it becomes fireable. The result is
    that it removes a data token from each node in
    the firing set, performs its operation, and
    places a new data token on some or all of its
    output arcs.
  • It then ceases execution and waits to become
    fireable again.

21
Pure Dataflow Model (Continue)
  • By this method, instructions are scheduled for
    execution as soon as their operands become
    available.
  • This stands in contrast to the von Neumann
    execution model, in which an instruction is only
    executed when the program counter reaches it,
    regardless of whether or not it can be executed
    earlier than this.
  • The key advantage is that, in dataflow, more than
    one instruction can be executed in parallel.

22
Example
23
  • Under the von Neumann execution model, the
    program in Figure 1(a) would execute sequentially
    in three time units.
  • Under the dataflow execution model, the program
    in Figure 1(b) would execute sequentially in two
    time units.
  • It is clear that dataflow provides the potential
    to provide a substantial speed improvement by
    utilizing data dependencies to locate
    parallelism.
Write a Comment
User Comments (0)
About PowerShow.com