ROIS
Procedural vs Declarative
ROIS NPL is a hybrid language, in that it combines procedural and declarative programming. The procedural nature of NPL is evident, NPL programs consists of tasks, which are the equivalent of procedures in other procedural languages. Besides, NPL also contains elements that control the execution path of a program, like IF..THEN..ELSE..ENDIF and FOREACH..ENDFOR.
The declarative nature of NPL is apparent in the NPL elements that add and retrieve information from ROIS models. The next example which adds a data flow graph (used for computation) to a ROIS model demonstrates the declarative nature:
ADD COMPUTATION BMI:=weight/(length*length);
The example module shows another declarative element of NPL in the symptomsOfDisease task. The SELECT statement is the most important way to retrieve information from a model and make it available for further processing. SELECT retrieves nodes, links or relations from a model based on a declarative specification, which can be seen as a linear representation of a graph.