Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering
→ Notation used in the following
ast_relation(?Language, ?AstRelLabel : atom, ?AstNodeArguments : list) is nondet
type (label / functor) arg2 and arguments conforming to the Argument Descriptors in arg3.
//Relations do not have own identities//. This is what distinguishes them from AST nodes. All identities occuring as arguments in a relation fact are references to other facts, which represent AST nodes. Example (excerpt from Java AST definition):
ast_relation('Java',extendsT,[ ast_arg(sub, mult(1,1,no ), id, [classT]), ast_arg(super, mult(1,1,no ), id, [classT]) ]).
one argument being the id of some AST node and the other argument being the attribute value
attached to that node. This makes sense if such arguments can be optional or multi-valued but unordered (Ordered multi-valued arguments are represented as lists). For instance, in the Java AST definition ''modifierT'' adds various modifiers to elements such as classes, methods and fields:
ast_relation('Java',modifierT,[ ast_arg(id, mult(1,1,no ), id, [classT, fieldT, methodT, constructorT, classInitializerT]), ast_arg(modifier, mult(1,1,no ), attr, [atom]) ]).
one single argument being the id of some AST node. For instance, in the Java AST definition
''externT'' marks classes available only as byte-code:
ast_relation('Java',externT,[ ast_arg(id, mult(1,1,no ), id, [classT]) ]).