Basic Knowledge: Terms

Terms can represent any value- and data-type within the language.

Note: They have to be structured in the following form:

stringnumberlogicalvalueliteralvariablevariablelistLEFTANGULARBRACKETtermlistRIGHTANGULARBRACKETexpressionternary_operation

In short: Everything is a term.

All elements within the AgentSpeak(L++) code are terms, forming the building blocks of a super (generic) data structure. In our framework we distinguish two different types of terms:

  • Raw terms are terms with a native Java data type. In such a term any Java data structure can be stored, but it cannot be used by the normal behaviour mechanisms of the logic programming language. Unification and assignments are nonetheless possible on these raw data structures.
  • Other terms like literals are structured objects which are described in the following.

In LightJason an inheritance model exists to build a software architecture for these structured elements. The root element is the ITerm interface and the ITerm inheritance diagram shows the structure of the relations.

Examples

duration(60)
light(red)

Here 60 and red would be terms.