pl_decl.pl -- UML-Model to Prolog declarations

This file contains predicates to generate member-accessors for the term-classes found in a model.

For each class found in the model, the following predicates are defined, where * is the classes name. *term(?Term) Unifies Term with *(_,,....), where the number of arguments is chosen to match the number of attributes defined for the term-class. For each attribute defined for the term-class getters and setter of the form *_<AttributeName>(Term, Value) and *set<AttributeName>(Term, Value) are defined.

<Class>term(T) <Class><Attribute>(T, Value) <Class>set<Attribute>(T, Value)

This also defines predicates to generate a module-template from the informations found in the diagram. Such a module-template contains an appropriate module/2, definition exporting all public members of all classes found in the Model, followed by the automatically generated getters and setters, plus a (non-public) predicate 'model-meta'(M), which unifies M with the model the module-template was generated from. Such a template-file is named by appending '_decl' to the model's name and can be included in a file containing the (manual) implementation of any further predicates.

For example, if the model is named 'my_model', the template-file will be named 'my_model_decl.pl' and is to be included into the (handwritten) 'my_model.pl' by a :- include(my_model_decl). statement.

This is written against the structures defined in 'init_defs.pl' as it is used to generate the m0-accessors.

author
- Heiko Lewin
license
- GPL

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

pl_declfile(Arg1)