@@ -1176,18 +1176,6 @@ sCASP['attributed_rule'] = function(block) {
1176
1176
// IF the user has said defeasible, the second rule checks for defeats.
1177
1177
// In order to check for defeats, we just need the conclusion, so that's fine. But to check for applicability,
1178
1178
// we need the list of objects whose categories have been tested in the conditions.
1179
- var applicable_targets = [ ] ;
1180
- if ( checkbox_inapplicable ) {
1181
- // So get the next block from the conditions connector, check if it is an object category block, if so add
1182
- // to the list of categories, repeat until there is no next block.
1183
- var statement = this . getInputTargetBlock ( 'conditions' ) ;
1184
- while ( statement ) {
1185
- if ( statement . type == "new_object_category" ) {
1186
- applicable_targets . push ( sCASP . valueToCode ( statement , 'object' , sCASP . ORDER_ATOMIC ) ) ;
1187
- }
1188
- statement = statement . getNextBlock ( ) ;
1189
- }
1190
- }
1191
1179
var first_rule = "according_to(" + value_source + "," ;
1192
1180
var conclusion_parameters = deconstruct_term ( statements_conclusion ) ;
1193
1181
for ( var i = 0 ; i < conclusion_parameters . length ; i ++ ) {
@@ -1197,16 +1185,15 @@ sCASP['attributed_rule'] = function(block) {
1197
1185
}
1198
1186
}
1199
1187
first_rule += ") :- " ;
1200
- if ( checkbox_inapplicable ) {
1201
- for ( var t = 0 ; t < applicable_targets . length ; t ++ ) {
1202
- first_rule += "blawx_applies(" + value_source + "," + applicable_targets [ t ] . trim ( ) + "),\n" ;
1203
- }
1204
- }
1205
1188
currentBlock = this . getInputTargetBlock ( 'conditions' ) ;
1206
1189
while ( currentBlock ) {
1207
1190
var codeForBlock = getCodeForSingleBlock ( currentBlock ) ;
1208
- currentBlock = currentBlock . getNextBlock ( ) ;
1191
+ if ( currentBlock . type == "new_object_category" && checkbox_inapplicable ) {
1192
+ var target = sCASP . valueToCode ( currentBlock , 'object' , sCASP . ORDER_ATOMIC )
1193
+ codeForBlock += ",\nblawx_applies(" + value_source + "," + target . trim ( ) + ")" ;
1194
+ }
1209
1195
first_rule += codeForBlock ;
1196
+ currentBlock = currentBlock . getNextBlock ( ) ;
1210
1197
if ( currentBlock ) {
1211
1198
first_rule += ",\n" ;
1212
1199
}
0 commit comments