public Rule(int code, int[] in, int[] out) throws Exception{
		super();
		this.code = code;
		
		/*Throws an exception if in or out is not well formatted
		 * (which means not int triplets)*/
		if(in.length%3!=0 || out.length%3!=0){
			throw new TripleFormatException("Triples must be like \"(s p o)*\"");
		}
		
		/*Generate input triples from the int table*/
		this.in = new ArrayList<Triple>();
		for (int i=0; i<in.length; i+=3) {
			this.in.add(new Triple(in[i], in[i+1], in[i+2]));
		}

		/*Generate output triples from the int table*/
		this.out = new ArrayList<Triple>();
		for (int i=0; i<out.length; i+=3) {
			this.out.add(new Triple(out[i], out[i+1], out[i+2]));			
		}
	}