<commit_before>package de.tudresden.inf.lat.born.core.rule;

import java.util.ArrayList;
import java.util.List;

import de.tudresden.inf.lat.born.core.term.Clause;
import de.tudresden.inf.lat.born.core.term.Term;

/**
 * This is a rule for ProbLog.
 * 
 * @author <NAME>
 *
 */
public class FR3Rule implements CompletionRule {

	private final Clause clause;

	/**
	 * Constructs a new FR-3 rule.
	 */
	public FR3Rule() {
		FormulaConstructor c = new FormulaConstructor();

		Term r = c.newVar("R");
		Term x = c.newVar("X");
		Term b = c.newVar("B");

		Term head = c.inst(r, x, b);
		List<Term> body = new ArrayList<>();
		body.add(c.role(r));
		body.add(c.indiv(x));
		body.add(c.indiv(b));
		body.add(c.subx(x, c.exists(r, b)));

		this.clause = c.rule(head, body);
	}

	@Override
	public Term getHead() {
		return this.clause.getHead();
	}

	@Override
	public List<Term> getBody() {
		return this.clause.getBody();
	}

	@Override
	public String asString() {
		return this.clause.asString();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		} else if (!(obj instanceof FR3Rule)) {
			return false;
		} else {
			FR3Rule other = (FR3Rule) obj;
			return this.clause.equals(other.clause);
		}
	}
<commit_msg>Fix rule for query<commit_after>package de.tudresden.inf.lat.born.core.rule;

import java.util.ArrayList;
import java.util.List;

import de.tudresden.inf.lat.born.core.term.Clause;
import de.tudresden.inf.lat.born.core.term.Term;

/**
 * This is a rule for ProbLog.
 * 
 * @author <NAME>
 *
 */
public class FR3Rule implements CompletionRule {

	private final Clause clause;

	/**
	 * Constructs a new FR-3 rule.
	 */
	public FR3Rule() {
		FormulaConstructor c = new FormulaConstructor();

		Term r = c.newVar("R");
		Term x = c.newVar("X");
		Term b = c.newVar("B");
		Term a = c.newVar("A");

		Term head = c.inst(r, x, b);
		List<Term> body = new ArrayList<>();
		body.add(c.role(r));
		body.add(c.indiv(x));
		body.add(c.indiv(b));
		body.add(c.subx(x, c.exists(r, a)));
		body.add(c.subx(a, b));

		this.clause = c.rule(head, body);
	}

	@Override
	public Term getHead() {
		return this.clause.getHead();
	}

	@Override
	public List<Term> getBody() {
		return this.clause.getBody();
	}

	@Override
	public String asString() {
		return this.clause.asString();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		} else if (!(obj instanceof FR3Rule)) {
			return false;
		} else {
			FR3Rule other = (FR3Rule) obj;
			return this.clause.equals(other.clause);
		}
	}

{'fraction_non_alphanumeric': 0.16451738960531456, 'fraction_numerical': 0.004689331770222743, 'mean_word_length': 3.391080617495712, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5109101', 'n_tokens_mistral': 1057, 'n_tokens_neox': 976, 'n_words': 222}