User Tools

Site Tools


This is an old revision of the document!

At the orgin of Ptidej was Herve Albin-Amiot's and my work on the specification of design motifs and the identification of occurrences and the automated generation of code. The identification of occurrences of design motifs is performed using an explanation-based constraint solver, built on top of PaLM and JChoco. Using Ptidej Solver, it is possible to identify occurrences of several built-in design motifs or other recurring patterns. Typically, a call to the constraint solver is made like:

public class DesignMotifIdentificationCallerSimple {
	public static void main(final String[] args) throws FileNotFoundException,
			IOException {

		final String path = "../Ptidej Solver Tests/rsc/JHotDraw v5.2.jar";
		final String name = "JHotDraw v5.2.ini";

		final IIdiomLevelModel idiomLevelModel =
		final IWalker constraintModelBuilder = new Generator();
		final List listOfModelEntities =, constraintModelBuilder);
		final Problem constraintProblem =

		final Writer writer = ProxyDisk.getInstance().fileTempOutput(name);
		constraintProblem.setWriter(new PrintWriter(writer));

		final Reader reader = ProxyDisk.getInstance().fileTempInput(name);
		final Properties properties = new Properties();
		properties.load(new ReaderInputStream(reader));
		final OccurrenceBuilder solutionBuilder =
		final Occurrence[] solutions =

		System.out.print("Found ");
		System.out.println(" solutions.");
ptidej_solver.1380118829.txt.gz · Last modified: 2018/03/04 02:53 (external edit)