Soar::Production - REPRESENT SOAR PRODUCTIONS
version 0.03
use Soar::Production qw(prods_from prods_from_file);
my $prods = prods_from_file( '/path/to/file' );
for my $prod (@$prods){
print $prod->name . "\n";
}
my $prod =
'sp{myName
(state <s>)
-->
(<s> ^foo bar)
}';
my $prod = Soar::Production->new($prod);
This is a module for storing, manipulating, and querying Soar productions. There isn't much functionality implemented, yet. Currently there are functions for
Soar::Production- Store and manipulate Soar productions
Argument: text of a Soar production. Creates a new production object using the input text.
Optional argument: name to assign production. Sets the name of the current production if an argument is given. Returns the name of the production.
The following functions may be exported:
A shortcut for prods_from(file =
$arg)>.
This method extracts productions from a given text. It returns a reference to an array containing production objects. Note that all comments are removed as a preprocessing step to detecting and extracting productions. It takes a set of named arguments:
file
- the name of a file to read.
text
- the text to read.
You must choose to export this function via the use
function:
use Soar::Production qw(prods_from);
Set/get name of matched state
Set/get name of matched state's superstate
Does this production match a state or an impasse?
Check this production against a datamap.
Soar::Production::Parser does not check semantic correctness. The following are good things to check:
- everything matched in RHS must be in LHS
- no empty RHS
- Only allowable non-operator preference is REJECT
- Check for existence of RHS function
not connected- disconnect from goal or impasses (no 'state' or 'impasse' keyword)
Nathan Glenn garfieldnate@gmail.com
This software is copyright (c) 2012 by Nathan Glenn.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.