Access Control is now enabled for Gitlab Pages so you can now restrict Pages to authorized users only. If needed, make your website publicly available : Navigate to your project's Settings > General > Visibility and select Everyone in pages section.

Commit 5712ca62 authored by Tony Licata's avatar Tony Licata

Converted =/2, </2, =</2, >/2, >=/2 builtins into Truffle nodes.

parent dc782252
......@@ -10,6 +10,7 @@ import java.nio.charset.Charset;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -30,11 +31,8 @@ public final class ProloGraalConsultBuiltin extends ProloGraalBuiltinClause {
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
ProloGraalAtom consultAtom = new ProloGraalAtom(getVariables(),"consult");
head.setFunctor(consultAtom);
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
setHead(head);
}
......@@ -78,4 +76,17 @@ public final class ProloGraalConsultBuiltin extends ProloGraalBuiltinClause {
return new ProloGraalConsultBuiltin(context);
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
ProloGraalAtom consultAtom = new ProloGraalAtom(variables,"consult");
head.setFunctor(consultAtom);
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
return head;
}
}
......@@ -8,6 +8,7 @@ import com.oracle.truffle.api.source.Source;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
......@@ -28,11 +29,8 @@ public final class ProloGraalConsultStringBuiltin extends ProloGraalBuiltinClaus
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
ProloGraalAtom consultAtom = new ProloGraalAtom(getVariables(),"consultstring");
head.setFunctor(consultAtom);
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
setHead(head);
}
......@@ -62,4 +60,17 @@ public final class ProloGraalConsultStringBuiltin extends ProloGraalBuiltinClaus
return new ProloGraalConsultStringBuiltin(context);
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
ProloGraalAtom consultAtom = new ProloGraalAtom(variables,"consultstring");
head.setFunctor(consultAtom);
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
return head;
}
}
package ch.heiafr.prolograal.builtins.predicates;
import ch.heiafr.prolograal.nodes.*;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Class representing the '='(A,B) predicate.
......@@ -11,31 +16,28 @@ import java.util.HashMap;
* @author Licata Tony
* @see ProloGraalBuiltinClause
*/
public final class ProloGraalEqualBuiltin extends ProloGraalBuiltinClause {
public abstract class ProloGraalEqualBuiltin extends ProloGraalBuiltinClause {
private final ProloGraalContext context; // we keep the context for the copy method
private ProloGraalVariable arg; // the variable A in is(A,B). We keep it to use it in the execute method
private ProloGraalVariable arg2; // the variable B in is(A,B). We keep it to use it in the execute method
public ProloGraalEqualBuiltin(ProloGraalContext context) {
public ProloGraalEqualBuiltin() {
super(new HashMap<>());
this.context = context;
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
head.setFunctor(new ProloGraalAtom(getVariables(), "="));
// we create and store the variables to access them more easily later in the execute method
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
arg2 = new ProloGraalVariable(getVariables(), "B");
head.addSubterm(arg2);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
arg2 = head.getArguments().get(1).asVariable();
setHead(head);
}
@Specialization
public ProloGraalBoolean returnHead(VirtualFrame frame, ProloGraalBoolean head){
return head;
}
/**
* Execute the '='/2 predicate, returning success if a part can be unified with the other one
*/
......@@ -48,7 +50,28 @@ public final class ProloGraalEqualBuiltin extends ProloGraalBuiltinClause {
// override the default copy so we do not lose the built-in status
@Override
public ProloGraalClause copy() {
return new ProloGraalEqualBuiltin(context);
ProloGraalTerm copiedHead = copyHead();
List<ProloGraalTerm<?>> headArgs = copiedHead.asStructure().getArguments();
return ProloGraalEqualBuiltinNodeGen.create(ProloGraalEqualHeadNodeGen.create(copiedHead,new ProloGraalSimpleTermNode(headArgs.get(0)),new ProloGraalSimpleTermNode(headArgs.get(1))));
}
// override getHead method to handle AST node head
@Override
public ProloGraalTerm<?> getHead(){
return ((ProloGraalEqualHeadNode)NodeUtil.findNodeChildren(this).get(0)).getValue();
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
head.setFunctor(new ProloGraalAtom(variables, "="));
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
ProloGraalVariable arg2 = new ProloGraalVariable(variables, "B");
head.addSubterm(arg2);
return head;
}
}
package ch.heiafr.prolograal.builtins.predicates;
import ch.heiafr.prolograal.nodes.*;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Class representing the '>='(A,B) predicate.
......@@ -11,31 +16,27 @@ import java.util.HashMap;
* @author Licata Tony
* @see ProloGraalBuiltinClause
*/
public final class ProloGraalGEBuiltin extends ProloGraalBuiltinClause {
public abstract class ProloGraalGEBuiltin extends ProloGraalBuiltinClause {
private final ProloGraalContext context; // we keep the context for the copy method
private ProloGraalVariable arg; // the variable A in is(A,B). We keep it to use it in the execute method
private ProloGraalVariable arg2; // the variable B in is(A,B). We keep it to use it in the execute method
public ProloGraalGEBuiltin(ProloGraalContext context) {
public ProloGraalGEBuiltin() {
super(new HashMap<>());
this.context = context;
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
head.setFunctor(new ProloGraalAtom(getVariables(), ">="));
// we create and store the variables to access them more easily later in the execute method
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
arg2 = new ProloGraalVariable(getVariables(), "B");
head.addSubterm(arg2);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
arg2 = head.getArguments().get(1).asVariable();
setHead(head);
}
@Specialization
public ProloGraalBoolean returnHead(VirtualFrame frame, ProloGraalBoolean head){
return head;
}
/**
* Execute the '>='/2 predicate, returning success if left part is greater or equal right part
*/
......@@ -50,7 +51,29 @@ public final class ProloGraalGEBuiltin extends ProloGraalBuiltinClause {
// override the default copy so we do not lose the built-in status
@Override
public ProloGraalClause copy() {
return new ProloGraalGEBuiltin(context);
ProloGraalTerm copiedHead = copyHead();
List<ProloGraalTerm<?>> headArgs = copiedHead.asStructure().getArguments();
return ProloGraalGEBuiltinNodeGen.create(ProloGraalGEHeadNodeGen.create(copiedHead,new ProloGraalSimpleTermNode(headArgs.get(0)),new ProloGraalSimpleTermNode(headArgs.get(1))));
}
// override getHead method to handle AST node head
@Override
public ProloGraalTerm<?> getHead(){
return ((ProloGraalGEHeadNode) NodeUtil.findNodeChildren(this).get(0)).getValue();
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
head.setFunctor(new ProloGraalAtom(variables, ">="));
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
ProloGraalVariable arg2 = new ProloGraalVariable(variables, "B");
head.addSubterm(arg2);
return head;
}
}
package ch.heiafr.prolograal.builtins.predicates;
import ch.heiafr.prolograal.nodes.*;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.BiFunction;
/**
* Class representing the '>'(A,B) predicate.
......@@ -14,31 +16,28 @@ import java.util.function.BiFunction;
* @author Licata Tony
* @see ProloGraalBuiltinClause
*/
public final class ProloGraalGTBuiltin extends ProloGraalBuiltinClause {
public abstract class ProloGraalGTBuiltin extends ProloGraalBuiltinClause {
private final ProloGraalContext context; // we keep the context for the copy method
private ProloGraalVariable arg; // the variable A in is(A,B). We keep it to use it in the execute method
private ProloGraalVariable arg2; // the variable B in is(A,B). We keep it to use it in the execute method
public ProloGraalGTBuiltin(ProloGraalContext context) {
public ProloGraalGTBuiltin() {
super(new HashMap<>());
this.context = context;
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
head.setFunctor(new ProloGraalAtom(getVariables(), ">"));
// we create and store the variables to access them more easily later in the execute method
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
arg2 = new ProloGraalVariable(getVariables(), "B");
head.addSubterm(arg2);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
arg2 = head.getArguments().get(1).asVariable();
setHead(head);
}
@Specialization
public ProloGraalBoolean returnHead(VirtualFrame frame, ProloGraalBoolean head){
return head;
}
/**
* Execute the '>'/2 predicate, returning success if left part is greater than right part
*/
......@@ -53,7 +52,29 @@ public final class ProloGraalGTBuiltin extends ProloGraalBuiltinClause {
// override the default copy so we do not lose the built-in status
@Override
public ProloGraalClause copy() {
return new ProloGraalGTBuiltin(context);
ProloGraalTerm copiedHead = copyHead();
List<ProloGraalTerm<?>> headArgs = copiedHead.asStructure().getArguments();
return ProloGraalGTBuiltinNodeGen.create(ProloGraalGTHeadNodeGen.create(copiedHead,new ProloGraalSimpleTermNode(headArgs.get(0)),new ProloGraalSimpleTermNode(headArgs.get(1))));
}
// override getHead method to handle AST node head
@Override
public ProloGraalTerm<?> getHead(){
return ((ProloGraalGTHeadNode) NodeUtil.findNodeChildren(this).get(0)).getValue();
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
head.setFunctor(new ProloGraalAtom(variables, ">"));
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
ProloGraalVariable arg2 = new ProloGraalVariable(variables, "B");
head.addSubterm(arg2);
return head;
}
}
package ch.heiafr.prolograal.builtins.predicates;
import ch.heiafr.prolograal.nodes.*;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Class representing the '=<'(A,B) predicate.
......@@ -11,31 +16,28 @@ import java.util.HashMap;
* @author Licata Tony
* @see ProloGraalBuiltinClause
*/
public final class ProloGraalLEBuiltin extends ProloGraalBuiltinClause {
public abstract class ProloGraalLEBuiltin extends ProloGraalBuiltinClause {
private final ProloGraalContext context; // we keep the context for the copy method
private ProloGraalVariable arg; // the variable A in is(A,B). We keep it to use it in the execute method
private ProloGraalVariable arg2; // the variable B in is(A,B). We keep it to use it in the execute method
public ProloGraalLEBuiltin(ProloGraalContext context) {
public ProloGraalLEBuiltin() {
super(new HashMap<>());
this.context = context;
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
head.setFunctor(new ProloGraalAtom(getVariables(), "=<"));
// we create and store the variables to access them more easily later in the execute method
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
arg2 = new ProloGraalVariable(getVariables(), "B");
head.addSubterm(arg2);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
arg2 = head.getArguments().get(1).asVariable();
setHead(head);
}
@Specialization
public ProloGraalBoolean returnHead(VirtualFrame frame, ProloGraalBoolean head){
return head;
}
/**
* Execute the '=<'/2 predicate, returning success if left part is less or equal right part
*/
......@@ -50,7 +52,29 @@ public final class ProloGraalLEBuiltin extends ProloGraalBuiltinClause {
// override the default copy so we do not lose the built-in status
@Override
public ProloGraalClause copy() {
return new ProloGraalLEBuiltin(context);
ProloGraalTerm copiedHead = copyHead();
List<ProloGraalTerm<?>> headArgs = copiedHead.asStructure().getArguments();
return ProloGraalLEBuiltinNodeGen.create(ProloGraalLEHeadNodeGen.create(copiedHead,new ProloGraalSimpleTermNode(headArgs.get(0)),new ProloGraalSimpleTermNode(headArgs.get(1))));
}
// override getHead method to handle AST node head
@Override
public ProloGraalTerm<?> getHead(){
return ((ProloGraalLEHeadNode) NodeUtil.findNodeChildren(this).get(0)).getValue();
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
head.setFunctor(new ProloGraalAtom(variables, "=<"));
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
ProloGraalVariable arg2 = new ProloGraalVariable(variables, "B");
head.addSubterm(arg2);
return head;
}
}
package ch.heiafr.prolograal.builtins.predicates;
import ch.heiafr.prolograal.nodes.*;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Class representing the '<'(A,B) predicate.
......@@ -11,31 +16,28 @@ import java.util.HashMap;
* @author Licata Tony
* @see ProloGraalBuiltinClause
*/
public final class ProloGraalLTBuiltin extends ProloGraalBuiltinClause {
public abstract class ProloGraalLTBuiltin extends ProloGraalBuiltinClause {
private final ProloGraalContext context; // we keep the context for the copy method
private ProloGraalVariable arg; // the variable A in is(A,B). We keep it to use it in the execute method
private ProloGraalVariable arg2; // the variable B in is(A,B). We keep it to use it in the execute method
public ProloGraalLTBuiltin(ProloGraalContext context) {
public ProloGraalLTBuiltin() {
super(new HashMap<>());
this.context = context;
// create the head of this clause
// since we do not need custom unification, a simple structure is enough
ProloGraalStructure head = new ProloGraalStructure(getVariables());
head.setFunctor(new ProloGraalAtom(getVariables(), "<"));
// we create and store the variables to access them more easily later in the execute method
arg = new ProloGraalVariable(getVariables(), "A");
head.addSubterm(arg);
arg2 = new ProloGraalVariable(getVariables(), "B");
head.addSubterm(arg2);
ProloGraalStructure head = createStandardHead(getVariables()).asStructure();
arg = head.getArguments().get(0).asVariable();
arg2 = head.getArguments().get(1).asVariable();
setHead(head);
}
@Specialization
public ProloGraalBoolean returnHead(VirtualFrame frame, ProloGraalBoolean head){
return head;
}
/**
* Execute the '<'/2 predicate, returning success if left part is less than right part
*/
......@@ -50,7 +52,29 @@ public final class ProloGraalLTBuiltin extends ProloGraalBuiltinClause {
// override the default copy so we do not lose the built-in status
@Override
public ProloGraalClause copy() {
return new ProloGraalLTBuiltin(context);
ProloGraalTerm copiedHead = copyHead();
List<ProloGraalTerm<?>> headArgs = copiedHead.asStructure().getArguments();
return ProloGraalLTBuiltinNodeGen.create(ProloGraalLTHeadNodeGen.create(copiedHead,new ProloGraalSimpleTermNode(headArgs.get(0)),new ProloGraalSimpleTermNode(headArgs.get(1))));
}
// override getHead method to handle AST node head
@Override
public ProloGraalTerm<?> getHead(){
return ((ProloGraalLTHeadNode) NodeUtil.findNodeChildren(this).get(0)).getValue();
}
/**
* Build a standard ProloGraalTerm that would tipically be the head of the builtin, with variables instead of "real args".
* @return a new ProloGraalTerm representing the head of the builtin
*/
public static ProloGraalTerm createStandardHead(Map<ProloGraalVariable,ProloGraalVariable> variables) {
ProloGraalStructure head = new ProloGraalStructure(variables);
head.setFunctor(new ProloGraalAtom(variables, "<"));
ProloGraalVariable arg = new ProloGraalVariable(variables, "A");
head.addSubterm(arg);
ProloGraalVariable arg2 = new ProloGraalVariable(variables, "B");
head.addSubterm(arg2);
return head;
}
}
package ch.heiafr.prolograal.nodes;
import ch.heiafr.prolograal.builtins.predicates.ProloGraalIsBuiltin;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@NodeInfo(shortName = "ProloGraalEqualHeadNode")
public abstract class ProloGraalEqualHeadNode extends ProloGraalBinaryHeadNode {
public ProloGraalEqualHeadNode(ProloGraalTerm<?> value) {
super(value);
}
@Specialization
public ProloGraalBoolean equal(VirtualFrame frame, ProloGraalTerm left, ProloGraalTerm right) {
return left.unify(right)||right.unify(left)?new ProloGraalSuccess():new ProloGraalFailure();
}
@Override
public ProloGraalBuiltinHeadNode copyBuiltin(Map<ProloGraalVariable, ProloGraalVariable> variables){
List<Node> childrens = NodeUtil.findNodeChildren(this);
ProloGraalTermNode left = (ProloGraalTermNode) childrens.get(0);
ProloGraalTermNode right = (ProloGraalTermNode) childrens.get(1);
return ProloGraalEqualHeadNodeGen.create(value.copy(variables), left.copyTermNode(variables), right.copyTermNode(variables));
}
}
package ch.heiafr.prolograal.nodes;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.List;
import java.util.Map;
@NodeInfo(shortName = "ProloGraalGEHeadNode")
public abstract class ProloGraalGEHeadNode extends ProloGraalBinaryHeadNode {
public ProloGraalGEHeadNode(ProloGraalTerm<?> value) {
super(value);
}
@Specialization
public ProloGraalBoolean greaterOrEqual(VirtualFrame frame, ProloGraalNumber left, ProloGraalNumber right) {
return left.asNumber().asDouble() >= right.asNumber().asDouble() ? new ProloGraalSuccess() : new ProloGraalFailure();
}
@Override
public ProloGraalBuiltinHeadNode copyBuiltin(Map<ProloGraalVariable, ProloGraalVariable> variables){
List<Node> childrens = NodeUtil.findNodeChildren(this);
ProloGraalTermNode left = (ProloGraalTermNode) childrens.get(0);
ProloGraalTermNode right = (ProloGraalTermNode) childrens.get(1);
return ProloGraalGEHeadNodeGen.create(value.copy(variables), left.copyTermNode(variables), right.copyTermNode(variables));
}
}
package ch.heiafr.prolograal.nodes;
import ch.heiafr.prolograal.runtime.*;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.nodes.NodeUtil;
import java.util.List;
import java.util.Map;
@NodeInfo(shortName = "ProloGraalGTHeadNode")
public abstract class ProloGraalGTHeadNode extends ProloGraalBinaryHeadNode {
public ProloGraalGTHeadNode(ProloGraalTerm<?> value) {
super(value);
}
@Specialization
public ProloGraalBoolean greaterThan(VirtualFrame frame, ProloGraalNumber left, ProloGraalNumber right) {
return left.asNumber().asDouble() > right.asNumber().asDouble() ? new ProloGraalSuccess() : new ProloGraalFailure();
}
@Override
public ProloGraalBuiltinHeadNode copyBuiltin(Map<ProloGraalVariable, ProloGraalVariable> variables){
List<Node> childrens = NodeUtil.findNodeChildren(this);
ProloGraalTermNode left = (ProloGraalTermNode) childrens.get(0);
ProloGraalTermNode right = (ProloGraalTermNode) childrens.get(1);
return ProloGraalGTHeadNodeGen.create(value.copy(variables), left.copyTermNode(variables), right.copyTermNode(variables));
}
}