<commit_before>package rogel.io.fopl.formulas;

import rogel.io.fopl.Symbol;

/**
 * A NegatedFormula is a Formula whose value is the opposite of the
 * value of another Formula it describes.
 * @author recardona
 */
public class NegatedFormula extends Formula {

	/** The Formula this class negates. */
	private Formula formula;
	
	public NegatedFormula(String name, Formula formula) {
		super(name);
		this.formula = formula; // The Formula this class describes.
		this.value = !this.formula.value; // This class' value is the opposite of the Formula it describes.
	}
	
	public NegatedFormula(Symbol symbol, Formula formula) {
		super(symbol);
		this.formula = formula;
		this.value = !this.formula.value;
	}
	
}<commit_msg>Added documentation for the NegatedFormula.<commit_after>package rogel.io.fopl.formulas;

import rogel.io.fopl.Symbol;

/**
 * A NegatedFormula is a Formula whose value is the opposite of the
 * value of another Formula it describes.
 * @author recardona
 */
public class NegatedFormula extends Formula {

	/** The Formula this class negates. */
	private Formula formula;
	
	/**
	 * Constructs a NegatedFormula with the given name, over the given Formula.
	 * If the name is a String that did not already exist within the domain of
	 * discourse (i.e. was already defined as a Symbol), then a new Symbol is
	 * created and added to the domain of discourse. The value of this Formula
	 * is the opposite of the parameter Formula (the Formula it describes). 
	 * @param name the name of the Formula
	 * @param formula the Formula this NegatedFormula describes
	 */
	public NegatedFormula(String name, Formula formula) {
		super(name);
		this.formula = formula; // The Formula this class describes.
		this.value = !this.formula.value; // This class' value is the opposite of the Formula it describes.
	}
	
	/**
	 * Constructs a NegatedFormula with the given Symbol, over the given
	 * Formula. The value of this Formula is the opposite of the parameter
	 * Formula (the Formula it describes).
	 * @param symbol the Symbol that represents this NegatedFormula within the
	 *   domain of discourse
	 * @param formula the Formula this NegatedFormula describes
	 */
	public NegatedFormula(Symbol symbol, Formula formula) {
		super(symbol);
		this.formula = formula;
		this.value = !this.formula.value;
	}
	
	@Override
	public String toString() {
		return "(not " + formula + ")";
	}
}
{'fraction_non_alphanumeric': 0.08326394671107411, 'fraction_numerical': 0.0, 'mean_word_length': 3.739644970414201, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3664', 'n_tokens_mistral': 705, 'n_tokens_neox': 651, 'n_words': 281}