Package net.fortytwo.ripple.model

Examples of net.fortytwo.ripple.model.RippleList.push()


            } else {
                // The stack to operate on
                RippleList restStack = stack.push(invertedListHead.getFirst()).push(operator);

                StackMapping restMapping = new InnerMapping(newListRest, invertedListHead.getRest(), operator);
                solutions.put(restStack.push(new Operator(restMapping)));
            }
        }
    }
}
View Full Code Here


            stack = stack.getRest();

            result = a.mul(a);

            solutions.put(
                    stack.push(result));
        }
    }
}
View Full Code Here

        stack = stack.getRest();
        x = stack.getFirst();
        stack = stack.getRest();

        solutions.put(
                stack.push(z).push(x).push(y).push(w));
    }
}
View Full Code Here

        RippleValue first = stack.getFirst();
        final RippleList rest = stack.getRest();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                solutions.put(rest.push(
                        new StackMappingWrapper(new PlusQuantifier(op), mc)));
            }
        };

        Operator.createOperator(first, opSink, mc);
View Full Code Here

        // Apply the function only if it is defined for the given argument.
        if (a > 0) {
            result = mc.valueOf(Math.log(a));

            solutions.put(
                    stack.push(result));
        }
    }

    @Override
    public StackMapping getInverse() throws RippleException {
View Full Code Here

        RippleValue f = stack.getFirst();

        Sink<Operator> opSink = new Sink<Operator>() {
            public void put(final Operator op) throws RippleException {
                RippleValue inverse = new StackMappingWrapper(op.getMapping().getInverse(), mc);
                solutions.put(rest.push(inverse));
            }
        };

        Operator.createOperator(f, opSink, mc);
    }
View Full Code Here

        Sink<RippleList> listSink = new Sink<RippleList>() {
            public void put(final RippleList list) throws RippleException {
                int result = list.length();
                solutions.put(
                        rest.push(mc.valueOf(result)));
            }
        };

        mc.toList(l, listSink);
    }
View Full Code Here

        if (x != 0 || y != 0) {
            result = Math.atan2(x, y);

            solutions.put(
                    stack.push(mc.valueOf(result)));
        }
    }

    @Override
    public StackMapping getInverse() throws RippleException {
View Full Code Here

        stack = stack.getRest();
        x = stack.getFirst();
        stack = stack.getRest();

        solutions.put(
                stack.push(z).push(Operator.OP).push(x).push(y));
    }
}
View Full Code Here

        stack = stack.getRest();
        x = stack.getFirst();
        stack = stack.getRest();

        solutions.put(
                stack.push(z).push(y).push(x));
    }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.