package sudoku;

import java.util.Collections;

/**
 * <p>An expression of a specific value of a cell in a sudoku puzzle.</p> <p>A {@link Rule Rule} is
 * equivalent to a specific true statement about its puzzle, indicating that exactly one of its
 * neighbors is true and all its other neighbor Claims are false. The collection of all the Rules of
 * a Puzzle is an expression of a system of equations. To solve this system, specific values are
 * needed, akin to the boundary or initial values needed to solve a system of differential
 * equations. An Init is such a value, and the collection of initial values provided for a sudoku
 * puzzle is typically sufficient to specify a unique solution of the entire system of equations
 * that the puzzle's Rules constitute.</p>
 * @author fiveham
 * @author fiveham
 *
 */
public class Init extends Fact {
	
    /**
     */
	private static final long serialVersionUID = 7730369667106322962L;
	
	private final Claim claim;
	
    /**
     * <p>Constructs an Init belonging to the specified {@code puzzle}, with an initial capacity of
     * {@value #CAPACITY}.</p>
     * @param puzzle
     */
	public Init(Puzzle puzzle, Claim c) {
		super(puzzle, Collections.singletonList(c), c.hashCode());
		this.claim = c;
	}
	
    /**
     * <p>Returns the Claim that this Init marks true.</p>
     * @return the Claim that this Init marks true
     */
	public Claim claim(){
		return claim;
	}
	
	@Override
	public String toString(){
		StringBuilder sb = new StringBuilder("An Init verifying ");
		for(Claim c : this){
			sb.append(c);
		}
		return sb.toString();
	}
	
	@Override
	public boolean equals(Object o){
		if(o instanceof Init){
			Init i = (Init) o;
			return claim.equals(i.claim);
		}
		return false;
	}
}

@@ -58,715 +58,286 @@
 %3EAn 
-expression of a specific value of a cell in a sudoku puzzle.%3C/p%3E %3Cp%3EA %7B@link Rule Rule%7D is%0A * equivalent to a specific true statement about its puzzle, indicating that exactly one of its%0A * neighbors is true and all its other neighbor Claims are false. The collection of all the Rules of
+Init marks the value of a cell whose value is given as part of the initial state of the 
 %0A * 
-a P
+p
 uzzle
- is an expression of a system of equations. To
+. It does this by being a Fact whose
  sol
-v
 e 
-this system, specific values are%0A * needed, akin to the boundary or initial values needed to solve a system of differential%0A * equations. An Init is such a value, and the collection of initial values provided for a sudoku%0A * puzzle is typically sufficient to specify a unique solution of the entire system of equations%0A * that the puzzle's Rules constitut
+element is the one Claim pertaining to that cell %0A * and that value, forcing that Claim to be true and all Claims visible to it to be fals
 e.%3C/
@@ -362,30 +362,8 @@
 ham%0A
- * @author fiveham%0A *%0A
  */%0A
@@ -401,24 +401,8 @@
 %7B%0A%09%0A
-    /**%0A     */%0A
 %09pri
@@ -497,26 +497,22 @@
 laim;%0A%09%0A
-  
   /**%0A
-  
    * %3Cp%3E
@@ -577,72 +577,136 @@
 e%7D, 
-with an initial capacity of%0A     * %7B@value #CAPACITY%7D.%3C/p%3E%0A 
+marking the specified claim %0A   * as true.%3C/p%3E%0A   * @param puzzle the puzzle one of whose initial values this Init indicates%0A
    
- 
 * @p
@@ -714,17 +714,92 @@
 ram 
-puzzle%0A  
+c the Claim made true by the puzzle having the initial value indicated by this Init%0A
    *
@@ -927,18 +927,14 @@
 %7D%0A%09%0A
-  
   /**%0A
-  
    *
@@ -989,18 +989,16 @@
 %3C/p%3E%0A   
-  
 * @retur
@@ -1035,18 +1035,16 @@
 ks true%0A
-  
    */%0A%09p

update Init javadoc