PROPHETS Hello World Demo

From jABC Manual Wiki
Jump to: navigation, search

Introductory Story

Map of available translations

Imagine you live in a European country, say Italy, and you want to send a "Hello World" greeting to someone living in, for instance, Portugal. But you don't know Portuguese (no other languages at all) and your Portuguese friend does not understand Italian. So what can you do? Perhaps send the message to someone who translates for you? But the problem is that no one in Italy can translate directly to Portuguese. The Italian translators only know how to translate into your neighboring countries' languages (Okay, here the example probably gets unrealistic, but you get the idea...). As every European translator only knows his/her neighbors' languages, you now need to find an appropriate sequence of them to translate from Italian to Portuguese, e.g. via France and Spain.

This "Hello World" example lets you model and execute those sequences as jABC workflow models. Furthermore, it is constructed to introduce the process synthesis capabilities of the PROPHETS framework.

Download and Installation

The example project is part of the jABC/PROPHETS installer that can be downloaded from the website. Please install this jABC version and make sure to remove ${userhome}/.JavaABC in advance (if you had a jABC installation before). The project will then be available automatically upon jABC launch.

Step-By-Step Tutorials

The project already contains example models (processes and domain definitions) for the following steps, so you can simply have a look at them or compare them to your files.

You should at least know the basics of jABC usage: placing SIBs, connecting SIBs and assigning branches, setting SIB parameters, defining a start SIB and executing a model using the tracer plugin. Please have a look at the Main Page for the UI introductions and the Tracer Manual.

Modeling/Executing Your First Hello World Workflow

  • open File: PTtoDE.xml
  • Plugins/Tracer/Trace... to step through while executing
  • The files ErrorInTranslation.xml and ErrorInUnderstanding.xml show (semantically) illegal workflows (Note: such are avoided automatically when using the synthesis).

Preparing the Domain for Synthesis

  • File prophets/modules.xml contains the main domain specification (use external editor to open)

Loose Specification and Synthesis

Create process (or use one of the existing loose specification examples)

  • Say (some language)
  • Understand (some other language)
  • Connect those two SIBs with an edge and assign the "default" branch to it.
  • Mark this branch as "loosely specified" using the ProphetsMarkBranch.png button in the top menu.
  • Start Synthesis by clicking the ProphetsStartSynthesis.png button.
  • When queried to choose a synthesis process, pick "pipelining". This can also be permanently configured using the configuration dialog: Plugins/PROPHETS/Plugin Configuration
  • The next wizard window lets you specify additional constraints for this synthesis run. It initializes with constraints that can be setup using Plugins/PROPHETS/Domain Setup/Edit Project Constraints. Don't change anything here for now.
  • In the following step you can specify limits for the search. See PROPHETS Configuration for information on what those values do. Set "max depth by factor" to 0 (we want to fully search the synthesis universe here), click "Start Search" and after synthesis has completed, "Next".
  • Choose one of the found solutions
  • After preview, the solution will be inserted into the jABC model, replacing the loosely specified branch (If your solution has a length > 1, it will be inserted using a GraphSIB)

Adding Domain-Specific Knowledge

As the SayXYZ services are part of the domain definition, every target language can be reached by simply inserting the appropriate Say-Service. To avoid this, we want to exclude the Say-services from the synthesis. This can be done by adding domain-specific knowledge. But as there are many Say-services, it makes sense to group all those using the service taxonomy and exclude the abstract service "Say". This is already done in the prepared project, but here are the locations where you can configure this:

  • Plugins/PROPHETS/Domain Setup/Edit Module Taxonomy
    • This opens the module taxonomy using the OntED editor
    • Concrete modules are instances in the ontology, abstract modules (the ones we want to define here) are classes.
    • CAUTION: you must not close or save this model manually. Use Plugins/PROPHETS/Domain Setup/Save and Close Module Taxonomy instead.
  • Plugins/PROPHETS/Domain Setup/Edit Project Constraints
    • This opens the editor that lets you define constraints that are used for every synthesis within this project
    • "Don't use the abstract module SayHello" prevents any of the modules that are instances of the class "SayHello" (from taxonomy, see above) to appear in a solution

Customizing the Synthesis Process

This is an advanced topic that allows you to implement parts of the synthesis process with project-specific SIBs. As an example, we here use a module provider that dynamically creates the synthesis information from a property file instead of reading many very similar entries from the prophets/modules.xml