Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visual Programming Languages ICS 539 Visual Logic Programming J

Similar presentations


Presentation on theme: "Visual Programming Languages ICS 539 Visual Logic Programming J"— Presentation transcript:

1 Visual Programming Languages ICS 539 Visual Logic Programming J
Visual Programming Languages ICS 539 Visual Logic Programming J. Augsti, et. All “A. Visual Syntax….”J. of Visual Languages and Computing, , ICS Department KFUPM Feb. 1, 2005

2 Introduction The increasing power of computers and the improvement of their graphical interfaces has fostered the development of visual programming. This, coupled with the interest in logic programming, naturally led researchers to devise various declarative programming languages.

3 Visual Logic Programming

4 Visual Logic The visual logic presented in this paper is based on two key ideas: 1) Predicates are presented by means of graphical sets (labeled boxes) denoting set abstractions over the predicates. The intended meaning of the predicate is described by means of graphical set inclusions (box containment) which denote the inclusion of the corresponding set abstractions. For example, the following diagram describes the predicate mortal by saying that every human is mortal:

5 Example The diagram denotes the inclusion of the set abstractions corresponding to each labeled box:

6 2) Predicate application are represented by means of arrows which together with boxes form directed acyclic graphs (DAGs). These DAGs correspond to the structured terms of logic. For instance, the simple DAG:

7 which translated to the textual form
parent(human) – the parents of some human denotes the following set abstraction: where the parents y are represented by the contents of the parent box.

8 These two kinds of visual metaphors can be combined.
For example, the following diagram defines the predicate grandparent:

9 It says that the parents of the parents of someone (a variable element represented by a circle) are his/her grandparents, and denotes the following inclusion: and the textual form of the diagram is

10 The key point of this visual syntax for logic is to represent visually the predicates as the set of elements that satisfy them, i.e. the set abstractions over them. Then inclusion of these sets corresponds to logical implication between set abstraction formulas, thus allowing an intuitive graphical representation of implication.

11 For example, the previous diagram defining the grandparent relation can be considered a visualization of the following implication:

12 Visual Terms We have two types of visual terms:
1) Element visual terms which denote individuals or elements of the universe of discourse. They are either: A circle representing a variable element. A labeled round box representing a constant element. A labeled round box with n incoming arrows representing a function of arity n where each arrow is applied to another element visual term.

13 Example - Element visual term

14 Set Visual Terms Set visual terms which denote sets of elements of the universe of discourse. They are either: A labeled rectangular box denoting the set corresponding to the unary predicate named by the label. A labeled rectangular box with n incoming arrows representing a predicate of arity n, where each arrow is applied to an element visual term or a set visual term.

15 An unlabeled box containing two set visual term roots, which denotes the union of the sets corresponding to these visual terms. An unlabeled box shared by two set visual term roots, both containing it. This denotes the intersection of the sets corresponding to these visual terms. A gray box linked by a line to the root of a set visual term. It denotes the set complementary to the set of the visual term.

16 Visual Constructs

17 Example – Set Visual Terms

18 Visual Formulas (Diagrams)
The goal of diagrams is to define logical predicates or relations. In every diagram there is a distinguished set term called the goal set term, which is an application to element terms of the predicate we want to define. To define a set term we indicate which are its elements, giving either the elements explicitly or a set term included in it. The goal set term is marked by drawing its box using thick lines.

19 Example Figure 6 shows an example of how diagrams are constructed.
First, in diagrams (a)-(c), we give different cases that satisfy the parent relation (the parents of Peter, Johnand Mary). Next, in diagrams (d) and (e) of the same figure we define the ancestor relation. In the first diagram, we state that parents are ancestors and in diagram (e) we formulate the recursive case: the ancestors of the parents of x are also ancestors of x. The last example, diagram (f ), defines descendant, the symmetric relation of ancestor. Note that this one is a diagram with two inclusions, one being the conclusion and the other the condition.

20 Example

21 If we translate to FOL the diagrams in Figure 6, with all variables implicitly universally quantified:

22 Thank You For Taking this Course and
Good Luck


Download ppt "Visual Programming Languages ICS 539 Visual Logic Programming J"

Similar presentations


Ads by Google