metrics for Prolog 
Author Message
 metrics for Prolog

Hi,

I am doing a research on measuring Prolog programs. I am trying to find some
metrics to measure the style the complexity and the correctness of a Prolog code.
I would like to ask if anyone knows about any article or any work or have any idea
about the subject cited above. I would appreciate the exchange of any ideas.

Thanks for your help,

Fatma



Sun, 19 Jul 1998 03:00:00 GMT  
 metrics for Prolog
I have a "Source Metrics" tool which is part of my Development Environment for LPA MacProlog. An example
ot the output of this tool is given below. The tool counts goals, clauses, goals per clause, goals per
predicate, and "tokens". The tokens are classed as operators or operands, and the basic Halstead Software
Science derived metrics are calculated. All of these values are gathered on a "per window" basis, since
LPA MacProlog organizes source code into windows, with one or more windows per source file.

The Halstead token counts as done by the Source Metrics tool are probably not exactly how I would do the
counts now. I am in the midst of rethinking some of these details.

There is nothing sophisticated here, I mostly did this out of curiosity to see what kind of
relationships, if any, there are between these various metrics.

An additional metric which can be easily calculated is a Logical Lines of Code, which is the sum of the
number of goals (elements of a clause bodies, one per line) and the number of clauses (putting the clause
head on its own line).

The example below is an analysis of the source for the interpreter for my set-based visual logic
programming language SPARCL. The LLOC for this file is 2646 (G + C).

The Source Metrics tool will sort the output on the user's choice of the first five columns (someday I'll
fix it to work on all of the columns...)

Sort Key: goals

Window                  G    C    P   GC   GP     Vol       S     Voc    UOtr    UOnd    TOtr    TOnd
11.1: psl ntuples an:  147   38   16  3.8  9.1    4668     745      77      38      39     374     371
13.0: linear form   :  135   41   15  3.2  9.0    4614     653     134      53      81     310     343
14.0: psl portray   :  120   36    9  3.3 13.3    2906     461      79      38      41     240     221
15.0: psli trace    :  117   17    3  6.8 39.0    5052     690     160      47     113     260     430
04.1: simplify_term :  113   30   10  3.7 11.3    2995     505      61      25      36     234     271
00.1-SPARCL Interpre:  109   21    5  5.1 21.8    2827     404     128      49      79     209     195
07.0: atomize       :   99   29   16  3.4  6.1    3050     523      57      30      27     256     267
15.1: Display Ancest:   96   19    9  5.0 10.6    2591     390     100      42      58     177     213
02.2: psli Evaluate :   95   27    9  3.5 10.5    4200     635      98      40      58     217     418
01.0: SPARCL Interpr:   90   33   14  2.7  6.4    4914     664     169      71      98     261     403
12.0: test_psli     :   83   27    3  3.0 27.6    6933    1011     116      28      88     432     579
04.0: partition_stru:   64   10    1  6.4 64.0    1841     323      52      26      26     156     167
08.0: analyze_unific:   58   17    2  3.4 29.0    1669     304      45      21      24     115     189
05.3: comparable_car:   58   14    3  4.1 19.3    1506     253      62      27      35     124     129
copy_references     :   57   12    9  4.7  6.3    1910     303      79      32      47     127     176
05.2: ntuple unifica:   53   10    1  5.3 53.0    1524     254      64      26      38     106     148
07.1: old atomize   :   48    2    1 24.0 48.0    1401     269      37      21      16     147     122
16.0: PSL Query Dial:   46    7    3  6.5 15.3    1543     236      93      33      60     103     133
06.0: unify_atomized:   46   20   10  2.3  4.6    2213     341      90      30      60     145     196
02.0.4: Solve Multis:   41    8    5  5.1  8.2    2164     323     104      40      64     117     206
10.0: valid_partitio:   40   16   10  2.5  4.0    1022     176      56      31      25      86      90
09.1: simplify_const:   39   12    9  3.2  4.3    1162     207      49      23      26      85     122
09.0: check_constrai:   38   10    7  3.8  5.4    1040     180      55      21      34      81      99
11.2: union sets    :   37   13    9  2.8  4.1    1088     191      52      21      31      75     116
02.0.1: Solve Operat:   33   23    5  1.4  6.6    5288     774     114      47      67     290     484
02.0.3: Solve Persis:   31    9    6  3.4  5.1    1151     195      60      34      26      80     115
02.1: delay_goal    :   30   11    7  2.7  4.2     744     134      47      22      25      57      77
02.0.0: sparcl_solve:   30   15    5  2.0  6.0    2807     414     110      53      57     164     250
02.0.2: Solve Setof :   24    4    3  6.0  8.0    1356     214      81      29      52      74     140
12.1: NQueens test  :   22    3    1  7.3 22.0    5508     799     119      14     105     386     413
01.1: Order Literals:   19    6    3  3.1  6.3     477      88      43      21      22      43      45
05.0: partition_unif:   18    3    1  6.0 18.0     812     148      45      20      25      73      75
03.0: psl set_member:   14    6    1  2.3 14.0     401      90      22      10      12      28      62
05.1: match_identica:   12    4    2  3.0  6.0     394      86      24       8      16      30      56
11.0: connect_partit:   11    6    4  1.8  2.7     520     112      25       7      18      35      77
04.1.1: test_simplif:    8    6    2  1.3  4.0     461     102      23      10      13      61      41
*OVERALL WINDOWS*   : 2081  565  219  3.6  9.5  138526   13197    1445     458     987    5758    7439

GoalCount=G ClauseCount=C ProcedureCount=P
AvgGoalsPerClause=GC AvgGoalsPerProcedure=GP Volume=Vol
Size=S Vocabulary=Voc UniqueOperators=UOtr
UniqueOperands=UOnd TotalOperators=TOtr TotalOperands=TOnd



Mon, 20 Jul 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Summary: Metrics for Prolog

2. New Prolog Benchmark Metric

3. New Prolog Benchmark Metric

4. Prolog code metrics ?

5. Design your "Dream" Metric/Metric Tool

6. PDC prolog and prolog++ (object-prolog)

7. Metrics

8. Metrics

9. Metrics

10. ObjectStudio Metrics Package

11. VA/CORBA Server Metrics

12. Metrics

 

 
Powered by phpBB® Forum Software