gerrit_owners.PRED_owner_approved_2 Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gerrit-owners Show documentation
Show all versions of gerrit-owners Show documentation
Gerrit Plugin that provides a Prolog predicate for enabling per directory code review requirements.
The newest version!
package gerrit_owners;
/*
owner_approved/2 defined in src/main/prolog/gerrit_owners.pl
This file is generated by Prolog Cafe.
PLEASE DO NOT EDIT!
*/
import com.googlecode.prolog_cafe.lang.*;
import com.googlecode.prolog_cafe.builtin.*;
import static gerrit_owners.PRED_owner_approved_2.*;
final class PRED_owner_approved_2 extends Predicate.P2 {
public PRED_owner_approved_2(Term a1, Term a2, Operation cont) {
this.arg1 = a1;
this.arg2 = a2;
this.cont = cont;
}
@Override
public Operation exec(Prolog engine) {
// owner_approved(A,B):-owner(B,C),member(C,A),!
engine.setB0();
Term a1, a2, a3, a4;
Operation p1, p2;
a1 = arg1;
a2 = arg2;
// owner_approved(A,B):-['$get_level'(C),owner(B,D),member(D,A),'$cut'(C)]
a3 = new VariableTerm(engine);
//START inline expansion of $get_level(a(3))
if (! a3.unify(new IntegerTerm(engine.B0), engine.trail)) {
return engine.fail();
}
//END inline expansion
a4 = new VariableTerm(engine);
p1 = new PRED_$cut_1(a3, cont);
p2 = new PRED_member_2(a4, a1, p1);
return new PRED_owner_2(a2, a4, p2);
}
}