User Tools

Site Tools


ptidej_solver

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ptidej_solver [2010/03/11 22:39]
ptidejteam
ptidej_solver [2017/09/06 01:54]
Line 1: Line 1:
-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: 
  
-<​code>​ 
- final ICodeLevelModel codeLevelModel = 
- ​ Factory.getInstance().createCodeLevelModel(aName);​ 
- ​codeLevelModel.create( 
-  new CompleteClassFileCreator( 
- ​ DefaultFileRepository.getInstance(),​ 
-  new String[] { aClassPath }, 
- ​ true));​ 
- 
- final IIdiomLevelModel idiomLevelModel = 
- ​ (IIdiomLevelModel) new AACRelationshipsAnalysis().invoke( 
- ​ codeLevelModel);​ 
- 
- final Class problemClass = 
- ​ Class.forName( 
- ​ "​ptidej.solver.problem."​ + motifName + "​Motif"​);​ 
- final Method getProblemMethod = 
- ​ problemClass.getMethod( 
- ​ "​getProblem",​ 
-  new Class[] { List.class }); 
- 
- final Problem problem = 
- ​ (Problem) getProblemMethod.invoke( 
- ​ null,​ 
-  new Object[] { Manager.build(idiomLevelModel)});​ 
- 
- final FileWriter writer = new FileWriter(path);​ 
- ​problem.setWriter(new PrintWriter(writer));​ 
- ​problem.automaticSolve(true);​ 
- 
- final Properties properties = new Properties();​ 
- ​properties.load(new ReaderInputStream(new FileReader(path)));​ 
- final OccurrenceBuilder solutionBuilder = 
- ​OccurrenceBuilder.getInstance();​ 
- final Occurrence[] solutions = 
- ​ solutionBuilder.getCanonicalOccurrences(properties);​ 
-</​code>​ 
ptidej_solver.txt ยท Last modified: 2019/10/06 20:37 (external edit)