use of kodkod.ast.Expression in project org.alloytools.alloy by AlloyTools.
the class GEO159 method betweenDefn.
/**
* Returns the between_c_defn axiom.
*
* @return between_c_defn
*/
public final Formula betweenDefn() {
// all c, p, q, r: point |
// c->p->q->r in between <=> p != r && some p.endPoint & r.endPoint &
// q.innerPoint & partOf.c
final Variable c = Variable.unary("C");
final Variable p = Variable.unary("P");
final Variable q = Variable.unary("Q");
final Variable r = Variable.unary("R");
final Expression e = p.join(endPoint).intersection(r.join(endPoint)).intersection(q.join(innerPoint)).intersection(partOf.join(c));
final Formula f0 = c.product(p).product(q).product(r).in(between);
final Formula f1 = p.eq(q).not().and(e.some());
return f0.iff(f1).forAll(p.oneOf(point).and(q.oneOf(point)).and(r.oneOf(point)).and(c.oneOf(curve)));
}
use of kodkod.ast.Expression in project org.alloytools.alloy by AlloyTools.
the class LAT258 method leastUpperBoundJoin.
/**
* Returns the least_upper_bound_join axiom.
*
* @return the least_upper_bound_join axiom.
*/
public final Formula leastUpperBoundJoin() {
final Variable a = Variable.unary("A"), b = Variable.unary("B");
final Expression e0 = b.join(a.join(meet));
final Formula f0 = e0.some().implies(a.join(lessThan).intersection(b.join(lessThan)).in(e0.join(lessThan)));
return f0.forAll(a.oneOf(UNIV).and(b.oneOf(UNIV)));
}
use of kodkod.ast.Expression in project org.alloytools.alloy by AlloyTools.
the class LAT258 method lowerBoundMeet.
/**
* Returns the lower_bound_meet axiom.
*
* @return the lower_bound_meet axiom.
*/
public final Formula lowerBoundMeet() {
final Variable c = Variable.unary("C");
final Expression e0 = c.join(lessThan);
final Formula f0 = meet.join(c).in(e0.product(e0));
// all c: univ | meet.c in c.lessThan->c.lessThan
return f0.forAll(c.oneOf(UNIV));
}
use of kodkod.ast.Expression in project org.alloytools.alloy by AlloyTools.
the class LAT258 method greatestLowerBoundMeet.
/*
* fof(greatest_lower_bound_meet,axiom,( ! [A,B,C,D] : ( ( meet(A,B,C) &
* less_than(D,A) & less_than(D,B) ) => less_than(D,C) ) )).
*/
/**
* Returns the greatest_lower_bound_meet axiom.
*
* @return the greatest_lower_bound_meet axiom.
*/
public final Formula greatestLowerBoundMeet() {
final Variable a = Variable.unary("A"), b = Variable.unary("B");
final Expression e0 = b.join(a.join(meet));
final Formula f0 = e0.some().implies(lessThan.join(a).intersection(lessThan.join(b)).in(lessThan.join(e0)));
return f0.forAll(a.oneOf(UNIV).and(b.oneOf(UNIV)));
}
use of kodkod.ast.Expression in project org.alloytools.alloy by AlloyTools.
the class LAT258 method loLeDistr.
/**
* Returns the lo_le_distr axiom.
*
* @return the lo_le_distr axiom.
*/
public final Formula loLeDistr() {
final Variable a = Variable.unary("A"), b = Variable.unary("B"), c = Variable.unary("C");
final Expression h = c.join(b.join(join));
final Expression d = h.join(a.join(meet));
final Expression e = b.join(a.join(meet));
final Expression f = c.join(a.join(meet));
final Expression g = f.join(e.join(join));
final Formula f0 = d.product(g).in(lessThan);
// (c.(a.meet)).((b.(a.meet)).join) in lessThan
return f0.forAll(a.oneOf(UNIV).and(b.oneOf(UNIV)).and(c.oneOf(UNIV)));
}
Aggregations