Presentation is loading. Please wait.

Presentation is loading. Please wait.

Muhammed Al-MulhemVisual Languages - 3 1 Visual Programming Languages ICS 519 Paradigms ICS Department KFUPM Feb. 1, 2005.

Similar presentations


Presentation on theme: "Muhammed Al-MulhemVisual Languages - 3 1 Visual Programming Languages ICS 519 Paradigms ICS Department KFUPM Feb. 1, 2005."— Presentation transcript:

1 Muhammed Al-MulhemVisual Languages - 3 1 Visual Programming Languages ICS 519 Paradigms ICS Department KFUPM Feb. 1, 2005

2 Muhammed Al-MulhemVisual Languages - 3 2 Paradigms 1)Imperative Languages: –The features (Von Neumann architecture) are: Variables Assignment Control Structures

3 Muhammed Al-MulhemVisual Languages - 3 3 Textual Example main() { int i; for ( i=0 ; i<10 ; ++i) printf(" %d\n ", i); }

4 Muhammed Al-MulhemVisual Languages - 3 4 Visual Example Pascal- BLOX Language

5 Muhammed Al-MulhemVisual Languages - 3 5 2) Functional (Applicative) Languages –Function –Atom –List –Recursion

6 Muhammed Al-MulhemVisual Languages - 3 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))) (ELSENIL) ))

7 Muhammed Al-MulhemVisual Languages - 3 7 Visual Example Clarity Language

8 Muhammed Al-MulhemVisual Languages - 3 8 3) Object Oriented –Class –Object –Message passing

9 Muhammed Al-MulhemVisual Languages - 3 9 Textual Example 5 - 3 2 (3<5) ifTrue: [17] 17 i ← 2 [i<=9]whileTrue:[i print. i ← i + 3] 2 5 8

10 Muhammed Al-MulhemVisual Languages - 3 10 Visual Example Prograph is an example of a visual OOLs. It has a visual representation for the following OOP concepts: 1.Classes 2.Methods 3.Parallelism 4.Sequencing 5.Iteration 6.Conditional Look at the next figure.

11 Muhammed Al-MulhemVisual Languages - 3 11 Prograph Language

12 Muhammed Al-MulhemVisual Languages - 3 12 4) Logic languages –list –predicate –rule –goal

13 Muhammed Al-MulhemVisual Languages - 3 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 Muhammed Al-MulhemVisual Languages - 3 14 Visual Example Logic Languages Variable Constant

15 Muhammed Al-MulhemVisual Languages - 3 15 Predicate q() q(x)q(a,b) q qq ab

16 Muhammed Al-MulhemVisual Languages - 3 16 Rule person(x):-mother(x,y),father(x,y) person motherfather

17 Muhammed Al-MulhemVisual Languages - 3 17 program person MotherFather person ali

18 Muhammed Al-MulhemVisual Languages - 3 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 Muhammed Al-MulhemVisual Languages - 3 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 Muhammed Al-MulhemVisual Languages - 3 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 Muhammed Al-MulhemVisual Languages - 3 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 Muhammed Al-MulhemVisual Languages - 3 22 Example

23 Muhammed Al-MulhemVisual Languages - 3 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.


Download ppt "Muhammed Al-MulhemVisual Languages - 3 1 Visual Programming Languages ICS 519 Paradigms ICS Department KFUPM Feb. 1, 2005."

Similar presentations


Ads by Google