All Downloads are FREE. Search and download functionalities are using the official Maven repository.

astra.cartago.CartagoPropertyEvent Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
package astra.cartago;

import astra.event.Event;
import astra.reasoner.util.LogicVisitor;
import astra.term.Primitive;
import astra.term.Term;

public class CartagoPropertyEvent implements Event {
	public static final Primitive ADDED = Primitive.newPrimitive("+");
	public static final Primitive REMOVED = Primitive.newPrimitive("-");

	private Term type;
	private Term id;
	private Term formula;

	public CartagoPropertyEvent(Term type, Term id, Term formula) {
		this.type = type;
		this.id = id;
		this.formula = formula;
	}

	public String signature() {
		return "$cpe";
	}

	public String toString() {
		return type + "$cartago.event(" + id + "," + formula + ")";
	}

	public Term type() {
		return type;
	}

	public Term id() {
		return id;
	}

	public Term content() {
		return formula;
	}

	@Override
	public Object getSource() {
		return null;
	}

	@Override
	public Event accept(LogicVisitor visitor) {
		return new CartagoPropertyEvent((Term) type.accept(visitor), (Term) id.accept(visitor), (Term) formula.accept(visitor));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy