Information Technology Reference
In-Depth Information
components. We define all these objects as modules of an appropriate type. For
example the digital objects of the previous example are defined as:
JavaSourceFile( HelloWorld.java ).
C++SourceFile( HelloWorld.cc ).
TextEditor( NotePad ).
TextEditor( VI ).
JavaCompiler( javac ).
JavaVirtualMachine( JVM ).
A Module can be classified to one or more modules types. Additionally these
types can be organized hierarchically. Such taxonomies can be represented with
appropriate rules. For example the source files for Java and C++ are also TextFiles,
so we use the following rules:
TextFile(X) :- JavaSourceFile(X).
TextFile(X) :- C++SourceFile(X).
We can also capture several features of digital objects using predicates (not
necessarily unary), i.e.
ReadOnly( HelloWorld.java ).
LastModifDate( HelloWorld.java , 2009-10-18 ).
Tasks - Dependencies - Dependency Type Hierarchies
Tasks and their dependencies are modelled using rules. For every task we use two
predicates; one (which is usually unary) to denote the task and another one (of
arity equal or greater than 2) for denoting its dependencies. Consider the following
example:
IsEditable(X) :- Editable(X,Y).
Editable(X,Y) :- TextFile(X), TextEditor(Y).
The first rule denotes that an object X is editable if there is any Y such that
X is editable by Y. The second rule defines a dependency between two modules
specifically it defines that every TextFile depends on a TextEditor for editing its
contents. Notice that if there are more than one text editors available (as here) then
the above dependency is interpreted disjunctively (i.e. every TextFile depends on
any of the two TextEditors). Relations of higher arity can be employed according to
the requirements e.g.
IsRunnable(X) :- Runnable(X,Y,Z).
Runnable(X,Y,Z) :- JavaSourceFile(X),
Compilable(X,Y),
JavaVirtualMachine(Z).
Search WWH ::




Custom Search