Updates

  • 10/04/15 Results up
  • 10/02/15 Solutions for challenge up
  • 09/05/15 RV traces and ext. file released
  • 08/26/15 Submission opened, RV dates updated
  • 07/18/15 RV training traces
  • 05/15/15 Training solutions up

Important Dates:

  • 05/15/15
       Solutions Training Phase
  • 08/01/15 - 09/04/15
       White Box Submission
  • 09/05/15
       Release Monitoring Input
  • 09/08/15
       RV Submission

Java Problems

Monitoring specific Java problem properties
The Java problems consist of a single Java class (ProblemX.java). The concrete set of inputs is specified at the top of the class definition as a set of plain character sequences (Strings) or their corresponding integer value for the integer version.

    private String[] inputs = {"D","E","A","F","B","C"};

The central method is calculateOutput, which comprises the program's logic. It is realized in terms of a sequence of nested if-then-else blocks. The state of a system is maintained in a set of attributes.

    public String calculateOutput(String input)    
    {
        if (cf && input.equals(inputs[2])             	
            && (b0==true && i0==9 && s0.equals("e"))) {
            s0 = "g";                           	
            b1 = true;
            System.out.println("Z");
        } 
        else if ... {
           ...
        }
        ...
        errorCheck();
    	if(cf)
    	throw new IllegalArgumentException("Current state has no transition for this input!");

    }

At the bottom of this method, there is a method errorCheck which contains a sequence of if-statements, checking whether the system is in an invalid state. If this is the case, an IllegalStateException with the respective error code is thrown.

	private void errorCheck() {
		...
		if(a23 && a3 && a6 && a26 == 3 && a15 && a18.equals("e"))
			throw new IllegalStateException( "error_23" );
		...
	}

Problems come with a main method, instantiating the problem and exposing it to continuous inputs on stdin which always produce output on stdout.

    public static void main(String[] args) throws IOException 
    {
        // init system
        Problem eca = new Problem();
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));

        // main i/o-loop
        while(true)
        {
            // read input
            String input = stdin.readLine();

            try{
              	//operate eca engine output = 
               	eca.calculateOutput(input);
            } catch(IllegalArgumentException e){
  	    	System.err.println("Invalid input: " + e.getMessage());
            }
        }
    }

The systems can be compiled using javac and executed using java without any prerequisites.

    $ javac ProblemX.java 
    $ java ProblemX 
    A                                   
    X                                   
    .
    .
    .

Each monitoring java file contains an instance of a ProblemXExternal object, which is defined in the ProblemXExternal.java file.
private static Problem5External ex = new Problem5External();
At some points in the text variables in the ProblemXExternal object are updated or their values checked for certain values. The outcome of these checks influences the behaviour of the system. ProblemXExternal.java will be replaced at a later point in the challenge, so you have access to the real system behaviour. Please read the rules page for further information.
ex.check69(10)

The systems can be compiled using javac and executed using java without any prerequisites.

    $ javac ProblemX.java ProblemXExternal.java
    $ java ProblemX 
    A                                   
    X                                   
    .
    .
    .