-
-
- Using the Prolog IDE
-
-
-
Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
There are three multifile predicates that are relevant for the integration of an analysis.
prolog_analysis_api:analysis_definition(Name, Severity, Category, Description)
prolog_analysis_api:analysis_category(Name, Description)
prolog_analysis_api:analysis_result(Name, File, Location, Description)
Each result of this predicate represents one analysis result. An analysis result consists of a File, a Location in this file and a Description. This predicate is called in mode (+, -, -, -).
The PDT Tutorial project contains a small example which is listed below.
The example finds all clauses of the predicate outline_demo:likes/2
.
:- multifile(prolog_analysis_api:analysis_definition/4). :- multifile(prolog_analysis_api:analysis_category/2). :- multifile(prolog_analysis_api:analysis_result/4). prolog_analysis_api:analysis_definition('Example Analysis', info, 'Example Category', 'This is an example analysis'). prolog_analysis_api:analysis_category('Example Category', 'This is an example category'). prolog_analysis_api:analysis_result('Example Analysis', File, Line, Description) :- nth_clause(outline_demo:likes(_, _), N, Ref), clause_property(Ref, file(File)), clause_property(Ref, line_count(Line)), format(atom(Description), 'This is the ~w. clause of likes/2', [N]).
The results listed in the Prolog Analyses view are shown below.