README-work

Raku DSL::FiniteStateMachines

In brief

This repository is for a Raku package with class definitions and functions for creation of Finite State Machines (FSMs) and their execution.

Usage example (Address book)

Here we load the definition of the class AddressBookCaller (provided by this package) and related entities package, "DSL::Entity::AddressBook":

use DSL::FiniteStateMachines::AddressBookCaller;

use DSL::Entity::AddressBook;
use DSL::Entity::AddressBook::ResourceAccess;

Here we obtain a resource object to access a (particular) address book:

my $resourceObj = DSL::Entity::AddressBook::resource-access-object();

Here we create the FSM and show its states:

my DSL::FiniteStateMachines::AddressBookCaller $abcFSM .= new;

$abcFSM.make-machine(($resourceObj,));

.say for $abcFSM.states;

(Each pair shows the name of the state object and the object itself.)

Here is the graph of FSM's state transitions:

$abcFSM.to-mermaid-js

Remark: In order to obtain a Mathematica -- or Wolfram Language (WL) -- representation of the state transitions graph the method to-wl can be used.

Here is how the dataset of the created FSM looks like:

.say for $abcFSM.dataset.pick(3);

For an interactive execution of the FSM we use the command:

#$abcFSM.run('WaitForCallCommand');

Here we run the FSM with a sequence of commands:

$abcFSM.run('WaitForCallCommand', 
        ["call an actor from LOTR", "", 
         "take last three", "", 
         "take the second", "", "", 
         "2", "5", "", 
         "quit"]);

Object Oriented Design

Here is the Unified Modeling Language (UML) diagram corresponding to the classes in this package:

(The UML spec and the Mermaid spec above were automatically generated with "UML::Translators", [AAp5].)

Here is the MermaidJS spec generation shell command:

to-uml-spec --format=MermaidJS DSL::FiniteStateMachines 

References

Packages

[AAp1] Anton Antonov, DSL::Shared Raku package, (2020), GitHub/antononcube.

[AAp2] Anton Antonov, DSL::Entity::Metadata Raku package, (2021), GitHub/antononcube.

[AAp3] Anton Antonov, DSL::English::DataAcquisitionWorkflows Raku package, (2021), GitHub/antononcube.

[AAp4] Anton Antonov, DSL::Entity::AddressBook Raku package, (2023), GitHub/antononcube.

[AAp5] Anton Antonov, UML::Translators Raku package, (2021), GitHub/antononcube.

Videos

[AAv1] Anton Antonov, "Multi-language Data Wrangling and Acquisition Conversational Agents (in Raku)", (2021), YouTube.com.

DSL::FiniteStateMachines v0.1.4

Finite State Machines (FSMs) roles and classes for making conversational agents based on Domain Specific Languages (DSLs).

Authors

  • Anton Antonov

License

Artistic-2.0

Dependencies

silently:ver<0.0.6+>DSL::English::DataQueryWorkflows:ver<0.6.1+>DSL::Entity::Metadata:ver<0.1.0+>DSL::Entity::AddressBook:ver<0.1.0+>DSL::Shared:ver<0.2.4+>Data::ExampleDatasets:ver<0.2.3+>Data::Generators:ver<0.1.6+>Data::Reshapers:ver<0.3.0+>Data::Summarizers:ver<0.2.3+>Data::TypeSystem:ver<0.1.4+>XDG::BaseDirectory:ver<0.0.14+>

Test Dependencies

Provides

  • DSL::FiniteStateMachines
  • DSL::FiniteStateMachines::AddressBookCaller
  • DSL::FiniteStateMachines::AddressBookCaller::AddressBookActions
  • DSL::FiniteStateMachines::AddressBookCaller::AddressBookGrammar
  • DSL::FiniteStateMachines::AddressBookCaller::FSMGlobalCommand
  • DSL::FiniteStateMachines::AddressBookCaller::Utilities
  • DSL::FiniteStateMachines::DataObtainer
  • DSL::FiniteStateMachines::DataObtainer::FSMGlobalCommand
  • DSL::FiniteStateMachines::FSMReactish
  • DSL::FiniteStateMachines::FSMish
  • DSL::FiniteStateMachines::QueryRetrieveActFSMRole
  • DSL::FiniteStateMachines::RecordsObtainer
  • DSL::FiniteStateMachines::RecordsObtainer::FSMGlobalCommand

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.