3.4  Aggregation Statements

Some F-Logic engines such as FLORA and FLORID support aggregation operators. These operators compute values pertained to the set of variable instantiations that occur in certain query. It is good to illustrate that by an example. The first rule computes the yearly average of the   daily  temperature in Burlington:

 

burlington[ avg_yearly_temperature--> TAvg]  :- 

                                         TAvg=   avg{ T | burlington[ temperature( Month)--> T]}.

Here TAvg is the average value of all T which would occur in query ?-burlington[ temperature( Month)--> T].

 

 

Here is another  rule. It  computes the minimum    daily  temperature in Burlington during the year.:

 

burlington[ min__yearly_temperature --> TMin]  :- 

                                           TMin=   min{ T | burlington[ temperature( Month)--> T]}.

TMin is the minimum value of all T which would occur in query ?-burlington[ temperature( Month)--> T].

 

Besides avg and min other aggregation operators are supported by FLORA and FLORID. Here is the full list of those supported by FLORA : min, max, count, sum, avg, collectset, collectbag. All these  aggregation operators have similar graphic representation. Here is the graphic representation of the   first rule mentioned above .

 

dot-code

 

 

Top     |  Previous   |   Next  

 

 

C 2003 S. Krivov  Send your comments to skrivov@zoo.uvm.edu