runC

Apply constrains to n-tuple file (or Test Set file) past as input (runC = run Constrains)

 

Input:

  1. {FILE }:        The Test Set or n-tuples file to which you want to apply constraints programmed into the file constrains.pm (Perl module)

 

Output:

  1. On the standard output are printed valid n-tuples or test cases; while on the standard error are printed invalid n-tuples or test cases. The output is printed on the standard output (usually the screen) and the standard error (usually coinciding with the standard output) and can be redirected to a file with the usual operations "pipe" DOS (> or >>).

 

 

Prerequisites:
1)    No one. The tool is not directly linked to other tools.

 

Example:

 

runC test_set.txt 1>validi.txt 2>non_validi.txt

 

Apply constraints programmed into the file constrains.pm (Perl language) and prints the valid records in the file "validi.txt" (records that meet the constraints) and invalid records in the file "non_validi.txt" (records that do not meet the constraints).

 

The file "constrains.pm" containing the filters is a module written in Perl, in which you can write the conditions that allow you to accept or discard the records in the file passed as input. The variable to be considered is the vector $r containing the values of the variables of the record read. In practice, for each line read, the following association is executed:


$r->[0]: current value of the first variable (A) on the line currently read
$r->[1]: current value of the second variable (B) on the line currently read

$r->[K]: current value of the (K-1)-th variable (J) on the line currently read

 

Each filter must return a value. The possible values are 0 or 1:
•    1: the row is considered not valid
•    0: the row is considered valid


For example:


    if($r->[0] eq "A1" && $r->[1] eq "B3"){
          return 1;                                               
     };

 

Each line of the input file is read and the condition is verified: if the value of the first variable A is "A1" and the value of the second variable B is "B3", line is discarded. In the current release of the product has not been implemented a mechanism to vary the values of the variables in the line of the file, in other words, a condition of the type:


    if($r->[0] eq "A1" && $r->[1] eq "B3"){
      $r->[1]="B2"
          return 0;                                               
     };

 

would not change the value of the second variable from "B3" to "B2"; then retuning 0, the line that should be excluded, would instead - wrongly - be taken as valid.
In other word, the filter validates or not validates the values, but does not change the content of the same.

Web Traffic

Today4
Yesterday34
This week35822
This month579
Total35822

Who Is Online

1
Online

Saturday, 16 December 2017 01:17
Powered by CoalaWeb