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

ExprParser.ExprTreeAaf Maven / Gradle / Ivy

Go to download

This project implements Affine Arithmetic Decision Diagrams (AADD) in Java. AADD permit in particular the symbolic execution of Java codes.

The newest version!
package ExprParser;

import jAADD.AADD;
import static jAADD.AADDMgr.REAL;

/**
 * Predefined function aaf that generates a new Affine Form with min, max, and the
 * key of a new noise symbol as parameters.
 */
class ExprTreeAaf extends ExprTreeFunction {
    ExprTreeAaf() {
        super(REAL, "aaf",
                new ExprTree("min", REAL),
                new ExprTree("max", REAL),
                new ExprTree("key", REAL));
    }

    void evalThis() throws ExprError {
        if (param.size() != 3) throw new ExprError("aaf requires 3 parameters: min, max, symbol no.");
        double l = getAADDParam(0).Value().getMin();
        double r = getAADDParam(1).Value().getMax();
        result = new AADD(l, r, (int) Math.round(getAADDParam(2).Value().getCentral()));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy