Search in sources :

Example 1 with SolverOption

use of jkind.SolverOption in project AGREE by loonwerks.

the class PreferencesUtil method getSolverOption.

public static SolverOption getSolverOption() {
    IPreferenceStore prefs = getPreferenceStore();
    String solverString = prefs.getString(PreferenceConstants.PREF_SOLVER).toUpperCase().replaceAll(" ", "");
    SolverOption solver = SolverOption.valueOf(solverString);
    return solver;
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) SolverOption(jkind.SolverOption)

Example 2 with SolverOption

use of jkind.SolverOption in project AMASE by loonwerks.

the class PreferencesUtil method getJKindApi.

private static JKindApi getJKindApi() {
    IPreferenceStore prefs = getPreferenceStore();
    JKindApi api = new JKindApi();
    api.setJKindJar(getJKindJar());
    try {
        api.setEnvironment("Z3_HOME", Z3Plugin.getZ3Directory());
    } catch (NoClassDefFoundError e) {
        e.printStackTrace();
    // Z3Plugin not present
    } catch (Exception e) {
        // Some unknown exception finding Z3
        e.printStackTrace();
    }
    String solverString = prefs.getString(PreferenceConstants.PREF_SOLVER).toUpperCase().replaceAll(" ", "");
    SolverOption solver = SolverOption.valueOf(solverString);
    api.setSolver(solver);
    if (prefs.getBoolean(PreferenceConstants.PREF_INDUCT_CEX)) {
        api.setInductiveCounterexamples();
    }
    if (prefs.getBoolean(PreferenceConstants.PREF_SMOOTH_CEX) && solver == SolverOption.YICES) {
        api.setSmoothCounterexamples();
    }
    if (prefs.getBoolean(PreferenceConstants.PREF_SUPPORT)) {
        api.setIvcReduction();
    }
    api.setN(prefs.getInt(PreferenceConstants.PREF_DEPTH));
    api.setTimeout(prefs.getInt(PreferenceConstants.PREF_TIMEOUT));
    api.setPdrMax(prefs.getInt(PreferenceConstants.PREF_PDR_MAX));
    // api.setPdrInvariants();
    if (prefs.getBoolean(PreferenceConstants.PREF_NO_KINDUCTION)) {
        api.disableKInduction();
    }
    return api;
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) SolverOption(jkind.SolverOption) JKindApi(jkind.api.JKindApi)

Example 3 with SolverOption

use of jkind.SolverOption in project AMASE by loonwerks.

the class PreferencesUtil method getSolverOption.

public static SolverOption getSolverOption() {
    IPreferenceStore prefs = getPreferenceStore();
    String solverString = prefs.getString(PreferenceConstants.PREF_SOLVER).toUpperCase().replaceAll(" ", "");
    SolverOption solver = SolverOption.valueOf(solverString);
    return solver;
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) SolverOption(jkind.SolverOption)

Example 4 with SolverOption

use of jkind.SolverOption in project AGREE by loonwerks.

the class PreferencesUtil method getJKindApi.

private static JKindApi getJKindApi() {
    IPreferenceStore prefs = getPreferenceStore();
    JKindApi api = new JKindApi();
    api.setJKindJar(getJKindJar());
    try {
        api.setEnvironment("Z3_HOME", Z3Plugin.getZ3Directory());
    } catch (NoClassDefFoundError e) {
        e.printStackTrace();
    // Z3Plugin not present
    } catch (Exception e) {
        // Some unknown exception finding Z3
        e.printStackTrace();
    }
    String solverString = prefs.getString(PreferenceConstants.PREF_SOLVER).toUpperCase().replaceAll(" ", "");
    SolverOption solver = SolverOption.valueOf(solverString);
    api.setSolver(solver);
    if (prefs.getBoolean(PreferenceConstants.PREF_INDUCT_CEX)) {
        api.setInductiveCounterexamples();
    }
    if (prefs.getBoolean(PreferenceConstants.PREF_SMOOTH_CEX) && solver == SolverOption.YICES) {
        api.setSmoothCounterexamples();
    }
    if (prefs.getBoolean(PreferenceConstants.PREF_SUPPORT)) {
        api.setIvcReduction();
    }
    api.setN(prefs.getInt(PreferenceConstants.PREF_DEPTH));
    api.setTimeout(prefs.getInt(PreferenceConstants.PREF_TIMEOUT));
    api.setPdrMax(prefs.getInt(PreferenceConstants.PREF_PDR_MAX));
    // api.setPdrInvariants();
    if (prefs.getBoolean(PreferenceConstants.PREF_NO_KINDUCTION)) {
        api.disableKInduction();
    }
    return api;
}
Also used : IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) SolverOption(jkind.SolverOption) JKindApi(jkind.api.JKindApi)

Aggregations

SolverOption (jkind.SolverOption)4 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)4 JKindApi (jkind.api.JKindApi)2