NAME
Soar::Production - REPRESENT SOAR PRODUCTIONS
VERSION
version 0.03
SYNOPSIS
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);
DESCRIPTION
This is a module for storing, manipulating, and querying Soar productions. There isn't much functionality implemented, yet. Currently there are functions for
NAME
Soar::Production- Store and manipulate Soar productions
METHODS
new
Argument: text of a Soar production. Creates a new production object using the input text.
name
Optional argument: name to assign production. Sets the name of the current production if an argument is given. Returns the name of the production.
EXPORTED FUNCTIONS
The following functions may be exported:
prods_from_file
A shortcut for prods_from(file =
$arg)>.
prods_from
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);
TODO
state_name
Set/get name of matched state
superstate_name
Set/get name of matched state's superstate
type
Does this production match a state or an impasse?
validate
Check this production against a datamap.
check semantic correctness
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
- <s> not connected
- disconnect from goal or impasses (no 'state' or 'impasse' keyword)
AUTHOR
Nathan Glenn <garfieldnate@gmail.com>
COPYRIGHT AND LICENSE
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.