Ql_baseopn Class Reference

#include <Ql_baseopn.hxx>

Inherits Ql_otherops.

Inheritance diagram for Ql_baseopn:

[legend]
Collaboration diagram for Ql_baseopn:
[legend]
List of all members.

Public Member Functions

 Ql_baseopn (int n, Ql_operation **p, int a)
virtual ~Ql_baseopn ()
int arity ()
void arity (int i)
Ql_operation * parameters (int i)
Ql_operation ** parameters ()
void parameters (Ql_operation **p)
void update_nesting_links ()
int has_params (Ql_operation **, int)
int has_params_com (Ql_operation **, int)
virtual int is_equiv (Ql_operation *, Ql_renaming *, Ql_iterop *)
int type_infer (int *)
int evaluate ()
int insert_one_property_one_subject_one_object ()
int modify_one_property_subject_object ()

Detailed Description

Class Ql_baseopn concerns the base operation of variable arity (set, tuple, ...). They are characterized by their parameters and arity.

Author:
Grigoris Karvounarakis

Stavros Sahtouris extented to support updates

Version:
1.0


Constructor & Destructor Documentation

Ql_baseopn::Ql_baseopn ( int  n,
Ql_operation **  p,
int  a 
)

Construction of a baseopn operation

Ql_baseopn::~Ql_baseopn (  )  [virtual]

Destruction of a baseopn operation


Member Function Documentation

int Ql_baseopn::arity (  )  [inline]

Returns:
the number of parameters of this operation

void Ql_baseopn::arity ( int  i  )  [inline]

Set the number of parameters of this operation to i

Ql_operation* Ql_baseopn::parameters ( int  i  )  [inline]

Returns:
the ith parameter of this operation

Ql_operation** Ql_baseopn::parameters (  )  [inline]

Returns:
an array with the parameters of this operation

void Ql_baseopn::parameters ( Ql_operation **  p  )  [inline]

Set the array with the parameters of this operation to p

void Ql_baseopn::update_nesting_links (  ) 

Update of the dependency links. A baseopn operation is nested in the most embedded iterator its parameters are nested in and depends on the variables belonging to this iterator and on which its parameters depend

int Ql_baseopn::has_params ( Ql_operation **  params,
int  nb_params 
)

Checks if "this" baseopn has the given parameters

Parameters:
params the array of parameters to compare with
nb_params the size of the given array
Returns:
true (1) if the parameters of "this" baseopn are exactly equal (pointer equality) and in the same order with the contents of the given array, false (0) otherwise

int Ql_baseopn::has_params_com ( Ql_operation **  params,
int  nb_params 
)

Checks if "this" baseopn has the given parameters

Parameters:
params the array of parameters to compare with
nb_params the size of the given array
Returns:
true (1) if the parameters of "this" baseopn are exactly equal (pointer equality), possibly in different order with the contents of the given array, false (0) otherwise

int Ql_baseopn::is_equiv ( Ql_operation *  op,
Ql_renaming *  renaming,
Ql_iterop *  circle 
) [virtual]

Used when testing the equivalence of two iterators. (see Ql_algiterop::is_equiv(Ql_operation *, Ql_renaming *, Ql_iterop *) Checks the equivalence of two operations inside the main query (circle=NULL) or inside an iterator (circle<>NULL) according to a variable renaming. The rule says that outside the circle the operations must be strictly equal and that inside they must be equivalent (variables renaming).

Parameters:
op the operation to check equivalence with
renaming a variable renaming
circle the iterator in which we check the equivalence
Returns:
true (1) if they are equivalent, false (0) otherwise

Implements Ql_operation.

int Ql_baseopn::type_infer ( int *  error_code  ) 

This function performs type inference and assigns evaluation functions for baseopns

Parameters:
error_code a placeholder, where an error code is put, in case of error
Returns:
KO (1) if an error occured, OK (1) otherwise

Check the type compatibility of insert_p_i update operation. If OK return OK, else return KO Although we classify it as baseopn, we actually know that the operation's function has 3 parameters

int Ql_baseopn::evaluate (  )  [virtual]

Baseopn evaluation differs from other baseop: we do not evaluate all the parameters because it is not always necessary (and, or)

Returns:
KO (1) if there was a runtime error, OK otherwise

Implements Ql_operation.

int Ql_baseopn::insert_one_property_one_subject_one_object (  ) 

The following matches all insert property cases: The first parameter is the property that is inserted. The second is the source and the third is the target of the property. The first should be a class instance, while the second can be either a class instance or a literal.

Precondition:
- The inserted property instance should not exist already

- The source should be instance of the domain and the target instance of the range of the property. If the target is a literal, it should be of the type that the property range implies

Postcondition:
- a side effect: If an instance of a super property of this property with the same source and target existed, it is removed from the DB (but contextually it is there, as the new instace is also an instance of the super property).

int Ql_baseopn::modify_one_property_subject_object (  ) 

For modify property: modify a (subject-object) property value to a (new_subject - new_object) property value

Precondition:
- the new property value is a valid value for this property

- the old property value exists as an instance of this property

- if the old value is an instance of a subproperty of this property the new value can also be a valid instance of the subproperty

Postcondition:
- the property has no instance (subject-object), but it has an instance (new_subject - new_object).

(side effects) - the subproperties of this property that had the old value as an instance, they now have the new value instead.

(side effects) - the superproperties of this property or a subproperty of this property that used to "see" the old instance, they now "see" the new instance instead.


The documentation for this class was generated from the following files:
Generated on Thu Oct 26 16:42:08 2006 for rul by  doxygen 1.5.0