Shared Flashcard Set

Details

Computerscience
Description
16
Other
Not Applicable
05/06/2008

Additional Other Flashcards

 


 

Cards

Term
What are the advantages of type theory , explain briefly?
Definition

There are many advantages of type decleration such as

    -type mismatch error

-memory optimization

- compile time operator disambiguation

-accuracy control

-compile time coercion.

Type mismatch error is caused if two diffrent variables do not have same declared or implicit types. Memory optimiization is possibe since diffrent types of data objects need diffrent amount of memory. By declearing type at memory appropriate memory alllocation can be done at compile time. Compile time operator disambiguation is possible since we know the type  of data objects at compile time. Compile time coercion is possible as variable  of the data type with less information can be transformed to variable of data type with more information.

Term
What is polymorphism?
Definition

Polymorphism is when the same function or operator can be used for more than type of data objects.

Term
What are two types of polymorphism?
Definition

-Universal,Adhoc

-Universal  polymorphism - data types are indefinite

-adhoc polymorphism - data types are finte  

Term
What are two universal polymorphism types?
Definition

parametric , inclusion.

Paremtric polymorphism -  types are passed as parameters to specialize a function for a a specific  type of data object

Inclusion polymorphism - a type is declared as subtype of the original type to inherit all the operations of the original type.

 

Term
What are the two types of adhoc polymorphism?
Definition

overloading,coercion.

overloading - an operator that can have multiple meanings is disambiguated by using the information of operands. 

coercion - a variable with type with less information is transformed to a varaible with more information when an operation involves both types of variables 

Term
What types of errors can not be picked by type declarations and why? Name and explain some instance of these types?
instances of these types of errors.
Definition
Type declearation can only pick up type mismatch errors, and can not pick up runtime errors since type information and boundry information is lost after compilation. Some examples are range check errors in arrays, substring arrays in selecting substring, variant record arrays when switch is mixed up , type violations when pointers are treated as distinct types.
Term
What is Name equivalence?
Definition
Name equivalence says two variable of types having diffrent names cannot be equated even when two types have the same structure.
Term
How can recursive data structures be modeled using set operations.?
Definition
Recursive types can be modeled as combination of disjoint union and Cartesian product: disjoint union is used to model the union of base case and recursive case in type definition, and cartesian product is used to connect multile catenations in recursive part of defintions.
Term
What are guarded commands and what are their rules of execution for them?
Definition
Guarded commands is non deterministic style of programming where slection part can be modeled in any order using guards. A block is a set of garded commands where each guraded command has two parts, a gard part and a command pat , gards are booleaon conditions that must be true to execute the command part. Guards in a block can be in any order. Only if the guards scueed command are eexecuted. Guards are necessary conditions thus that sucess of a guard does not ensure a solution.
Term
What do you understand by data datadependecny graph?
Definition
Data dependency graph is the connectivity of multiple statements in the program to show dependency of execution on of states on one another. It shows the order in which various statements can be executed without destroying the final outcome of the answertil producers have written the value
Term
What are the three golden rules of data depedency graph?
Definition

The three rules of data depedency graphs include

1. consumer of variables can not be executed until producers have written the value of variables.

2. new values can not be written for variables unless the statements consuming the old values of a variable are executed.

3. The statement using aliased variables should follow the order.  

Term
What is  fine grain conccurancy
Definition
Fine grain parallelism is when maximum concurrency is exploited at the statement level using data dependency graph.  The problem with data dependency graph is that after the processor allocation, many data elements have to be transfered from one process to another.  The overhead of packing unpacking data for data transfere is quite high that takes finge grin parallesim unattractive.
Term
what is coarse grain parallelism ?
Definition
Coarse grain parallelism groups multiple sequential statments on one machine and exploits concurrency between these blocks of multiple sequential statements. The blocks are sepreated such that there is minmum data transfer between these blocks, and these data transfers are grouped to reduce packing unpacking cost. Coarse grain parallelism is more suited because it reduces cost of data transfer between processors  that can make concurrent computation inefficient.
Term
what do you understand by program slicing?
Definition
Program slicing is the means  spliting the program into multiple blocks such that the data transfer between the various blocks is minimal. Each of these blocks are executed sequeintailly on diffrent processors  concurrently after data dependency graph is created.
Term
What are the two  rules  used in slicing a program?
Definition

Two standord techniques are used for program slicing:

1. if the number of statemens on one processor are  smaller than the cost of transfering the data to another procesor then it will be more efficient to group those statements on the other processor. 

2. keep multiple copies of producers that are consumed by statements in multiple processors.

 

Supporting users have an ad free experience!