LightJason - AgentSpeak(L++)
LightJason - AgentSpeak(L++)

Based on the project Jason by Jomi F. Hübner and Rafael H. Bordini a Java 9 implementation has been build-up with parallel execution calls. The version defines an additional AgentSpeak(L) grammar based on AntLR for simulating a multi-agent system with a fuzzy-based logical calculus and grammar features like lambda expressions. Agent execution based on a mathematical structure to describe an optimizing process by a finite-state-machine

## Base Definitions

### Belief

• Beliefs implicitly describe the current state of the agent
• Beliefs will be updated before the cycle is run (beliefbase uses an update mechanism)
• Beliefs must be exists iif an expression is computed (beliefs can be exist on the fly)
• Belief addition triggers a plan with the definition +belief
• Belief retraction triggers a plan with the definition -belief
• Belief modification with -+ does not exists anymore
• Variables within a belief literal will be unified before the belief is added to the beliefbase

### Action

• Actions will be run immediately
• Actions can fail (fuzzy-logic false) or succeed (fuzzy-logic true)
• There is no difference between internal and external actions
• Actions with @-prefix wil be executed in parallel (each inner action will be run in parallel)

### Plan

• Plans are sequences of actions, rules and/or achievement / test goals
• Plans has got an optional context, that defines a constraint for execution (default is fuzzy-logic true and matches always)
• Plans fail iif the defuzzyfication returns fuzzy-logic false
• Plans returns a boolean value which defines fail (fuzzy-logic false) and success (fuzzy-logic true)
• Plans run items in sequential order on default
• If the plan calls an achievement goal addition, the goal will be added for the next cycle
• An achievement goal deletion does not exists anymore

#### Internals Constants

• The plan has got additional constant variables, that are added in the context condition (values are calculated before plan execution is started)
• PlanFail stores the number of fail runs and PlanFailRatio normalized value in [0,1]
• PlanSuccessful stores the number of successful runs and PlanSuccessfulRatio normalized value in [0,1]
• PlanRuns number of runs of the plan (fail + successful runs)

#### Fuzziness

• Fuzzy value must be in [0,1]
• Each action in a fuzzy-plan returns also a fuzzy value to define the fuzziness
• The plan or rule result returns fuzzy-logic true / false and the aggregated fuzzy value

### Rule

• Rules are similar to plans without the context condition
• Rules cannot be triggered by a goal, so they must be called from a plan

### Action / Term Annotation

• In LightJason one can specify HOW actions and terms will be executed / unified.
• Concept of action-term-annotations allows to annotate actions, and terms to perform
• unification (>>)
• parallel execution (@), see Variables and lambda expressions.
• ...
• If more than one action-term-annotation is needs to be added, they have to be ordered according to the rule: First HOW, then WHAT, e.g. @>> (parallel unification)
• To annotate multiple actions/terms brackets (,) can be used. See the following examples
• Examples
• @>>( foo(X), X > 1 ) && Value > 0.5 (unify foo(X) and X > 1 in parallel and if this results in a true statement check whether Value > 0.5)
• >>foo(X) && X > 1 && Value > 0.5 (unify foo(X), then test the following terms sequentially)