📝 Report
For this task you are asked to build a PC configuration SMT problem and extract a solution from the model using JavaSMT.
Tip
As a first step see the introduction video for using JavaSMT for our purposes https://youtu.be/9ptEo4apVcU (36min).
Tip
Instead of encoding a fixed set of components, their prices, and constraints, (as shown in the JavaSMT video after minute 19:50) we are going to read them using an API provided in the project.
Implementation: All the code you need to write is in method createConfigFormula(BooleanFormulaManager bmgr, IntegerFormulaManager imgr, int budgetIN). This method should return a full formula representing the PC configuration problem as described below. You can add as many helper methods as you need.
- Components, their categories, and their prices can be read from files, i.e., they may change.
- The CSV formal for components is as follows:
category, name, price, e.g.CPU, i3, 113ormotherboard, ASUS, 100.
- The CSV formal for components is as follows:
- Constraints between components of kind
requiresandexcludes(similar to those in feature models) can be read from another file.- The CSV formal for constraints is as follows:
name, constraintKind, name, e.g.i3, requires, ASUSori3, excludes, MSI. WhereconstraintKindis eitherrequiresorexcludes. - Constraint
requiresmeans that the first component requires the second one, andexcludesmeans that each component excludes the other.
- The CSV formal for constraints is as follows:
- Every valid PC needs at least one component from each of these categories:
CPU,motherboard,RAM, andstorage. Components of other categories are optional (subject to other constraints). - Users provide a budget on the console.
- The selected components of a configuration are listed by the program, if a configuration within the budget exists.
Tip
A video going through the code is available from https://youtu.be/7Zxe99i_7EU.
To assess a quality aspect of the PC configuration solver, you are asked to analyze the generated formulas for redundant assertions.
-
Your code automatically generates example scenario formulas. Analyze these formulas for redundant assertions:
- Run
./gradlew buildto build the project (or simply run the test cases). - This will generate SMT scripts for different budgets in the task-2/ folder.
- Check these scripts in the FM Playground for redundant assertions using the redundancy analysis feature.
- Run
-
Reflect on the results of the analysis. Write a short summary of the results in the explanation.txt file. Consider whether you want to improve your encoding from Task 1 based on the results of the redundancy analysis. If so, implement these improvements and document them (also inside explanation.txt).