These rulebases focus on detecting contract violations based on measured versus required flops. Several different fuzzy logic rulebases are presented, each with corresponding plots showing the graphical representation of the fuzzy variables in the rulebase as well as the output of the decision procedure (the contract value) for a range of measured and required flops. The last rulebase, Rulebase 6, provides the best features to date.
Rulebase and graphical representations of fuzzy variables:
var requiredFlops(-20,60) { set triangle low ( 0, 20, 20 ); set triangle medium ( 20, 20, 20 ); set triangle high ( 40, 20, 20 ); }var measuredFlops(-20,60) { set triangle low ( 0, 20, 20 ); set triangle medium ( 20, 20, 20 ); set triangle high ( 40, 20, 20 ); }var contract(-0.5,1.5) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 ); }if (requiredFlops == low && measuredFlops == low) { contract = ok; } if (requiredFlops == low && measuredFlops == medium) { contract = ok; } if (requiredFlops == low && measuredFlops == high) { contract = ok; } if (requiredFlops == medium && measuredFlops == low) { contract = violated; } if (requiredFlops == medium && measuredFlops == medium) { contract = ok; } if (requiredFlops == medium && measuredFlops == high) { contract = ok; } if (requiredFlops == high && measuredFlops == low) { contract = violated; } if (requiredFlops == high && measuredFlops == medium) { contract = violated; } if (requiredFlops == high && measuredFlops == high) { contract = ok; }
Graphical representation of contract output for a range of required and measured FLOPS values:
Rulebase and graphical representations of fuzzy variables:
var requiredFlops(0,40) { set triangle low ( 0, 20, 20 ); set triangle medium ( 20, 20, 20 ); set triangle high ( 40, 20, 20 ); }var measuredFlops(0,40) { set trapez lt_medium ( -20, 0, 0, 20 ); set trapez gte_medium ( 20, 60, 20, 0 ); set trapez lt_high ( -20, 20, 0, 20 ); set trapez gte_high ( 40, 60, 20, 0 ); }var contract(-0.5,1.5) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 );}var def(-0.5,1.5) { set triangle false ( 0, 0.5, 0.5 ); set triangle true ( 1, 0.5, 0.5 ); }if (requiredFlops == low) { contract = ok; } if (requiredFlops == medium && measuredFlops == lt_medium) { contract = violated; } if (requiredFlops == medium && measuredFlops == gte_medium) { contract = ok; } if (requiredFlops == high && measuredFlops == lt_high) { contract = violated; } if (requiredFlops == high && measuredFlops == gte_high) { contract = ok; }
Graphical representation of contract output for a range of required and measured FLOPS values:
Rulebase and graphical representations of fuzzy variables:
var requiredFlops(-20,60) { set trapez lt_medium ( 0, 0, 0, 20 ); set trapez gte_medium ( 20, 40, 20, 0 ); set trapez lt_high ( 0, 20, 0, 20 ); set trapez gte_high ( 40, 40, 20, 0 ); }
var measuredFlops(-20,60) { set trapez lt_medium ( 0, 0, 0, 20 ); set trapez gte_medium ( 20, 40, 20, 0 ); set trapez lt_high ( 0, 20, 0, 20 ); set trapez gte_high ( 40, 40, 20, 0 ); }var contract(-0.5,1.5) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 ); }var def(-0.5,1.5) { set triangle false ( 0, 0.5, 0.5 ); set triangle true ( 1, 0.5, 0.5 ); }if (def == true) { contract = ok; certainty = 0.01; } if (requiredFlops == lt_medium && measuredFlops == gte_medium) { contract = ok; } if (requiredFlops == lt_high && measuredFlops == gte_high) { contract = ok; } if (requiredFlops == gte_medium && measuredFlops == lt_medium) { contract = violated; } if (requiredFlops == gte_high && measuredFlops == lt_high) { contract = violated; }
Graphical representation of contract output for a range of required and measured FLOPS values:
Rulebase and graphical representations of fuzzy variables:
var requiredFlops(0,40) { set trapez lt_low ( -10, -10, 0, 20 ); set trapez gte_low ( 10, 40, 20, 0 ); set trapez lt_medium ( 0, 0, 0, 20 ); set trapez gte_medium ( 20, 40, 20, 0 ); set trapez lt_high ( 0, 10, 0, 20 ); set trapez gte_high ( 30, 40, 20, 0 ); set trapez lt_veryhigh ( 0, 20, 0, 20 ); set trapez gte_veryhigh ( 40, 40, 20, 0 ); }var measuredFlops(0,40) { set trapez lt_low ( -10, -10, 0, 20 ); set trapez gte_low ( 10, 40, 20, 0 ); set trapez lt_medium ( 0, 0, 0, 20 ); set trapez gte_medium ( 20, 40, 20, 0 ); set trapez lt_high ( 0, 10, 0, 20 ); set trapez gte_high ( 30, 40, 20, 0 ); set trapez lt_veryhigh ( 0, 20, 0, 20 ); set trapez gte_veryhigh ( 40, 40, 20, 0 ); }var contract(0,1) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 ); }var def(0,1) { set triangle false ( 0, 0.5, 0.5 ); set triangle true ( 1, 0.5, 0.5 ); }if (def == true) { contract = ok; certainty = 0.01; }if (requiredFlops == gte_low && measuredFlops == lt_low) { contract = violated; } if (requiredFlops == gte_medium && measuredFlops == lt_medium) { contract = violated; } if (requiredFlops == gte_high && measuredFlops == lt_high) { contract = violated; } if (requiredFlops == gte_veryhigh && measuredFlops == lt_veryhigh) { contract = violated; }if (requiredFlops == lt_low && measuredFlops == gte_low) { contract = ok; } if (requiredFlops == lt_medium && measuredFlops == gte_medium) { contract = ok; } if (requiredFlops == lt_high && measuredFlops == gte_high) { contract = ok; } if (requiredFlops == lt_veryhigh && measuredFlops == gte_veryhigh) { contract = ok; }
Graphical representation of contract output for a range of required and measured FLOPS values:
Rulebase and graphical representations of fuzzy variables:
var requiredFlops( 0, 60 ) { set trapez lt_low ( -20, 0, 0, 20 ); set trapez gte_low ( 20, 80, 20, 0 ); set trapez lt_medium ( -20, 20, 0, 20 ); set trapez gte_medium ( 40, 80, 20, 0 ); set trapez lt_high ( -20, 40, 0, 20 ); set trapez gte_high ( 60, 80, 20, 0 ); }var measuredFlops( 0 ,60 ) { set trapez lt_low ( -20, 0, 0, 20 ); set trapez gte_low ( 20, 80, 20, 0 ); set trapez lt_medium ( -20, 20, 0, 20 ); set trapez gte_medium ( 40, 80, 20, 0 ); set trapez lt_high ( -20, 40, 0, 20 ); set trapez gte_high ( 60, 80, 20, 0 ); }
var contract( -0.5, 1.5 ) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 ); }
var def( -0.5, 1.5 ) { set triangle false ( 0, 0.5, 0.5 ); set triangle true ( 1, 0.5, 0.5 ); }
if (def == true) { contract = ok; certainty = 0.01; } if (requiredFlops == gte_low && measuredFlops == lt_low) { contract = violated; } if (requiredFlops == lt_low && measuredFlops == gte_low) { contract = ok; } if (requiredFlops == gte_medium && measuredFlops == lt_medium) { contract = violated; } if (requiredFlops == lt_medium && measuredFlops == gte_medium) { contract = ok; } if (requiredFlops == gte_high && measuredFlops == lt_high) { contract = violated; } if (requiredFlops == lt_high && measuredFlops == gte_high) { contract = ok; }
Graphical representation of contract output for a range of required and measured FLOPS values:
Rulebase and graphical representations of fuzzy variables:
var flopsRatio(0,2) { set trapez bad ( 0.0, 0.5, 0.0, 0.5 ); set trapez good ( 1.0, 2.0, 0.5, 0.0 ); }var contract(-0.5,1.5) { set triangle violated ( 0, 0.5, 0.5 ); set triangle ok ( 1, 0.5, 0.5 ); }if ( flopsRatio == bad ) { contract = violated; } if ( flopsRatio == good ) { contract = ok; }
Graphical representation of contract output for a range of required and measured FLOPS values:
This material is based upon work supported by the National Science Foundation under Grant No. 9975020.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Department of Computer Science
Last modified: Tuesday, July 03, 2001 03:20 PM