-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SMART stands for Systems Management of Alert Responsive Tasks.
This buffer is an updated version of one originally programmed as a requirement for NASA Space Grant Consortium funding. The initial application was for the management of multi-sensory artificial intellegince designed in 2011. The model began in a predicate calculus and was proven decidable as a context-free grammar. The updates of the latest version restrict input and learning algorithms to text and sound, removing attempts at incorporating vision. The output remains as both text and sound.
Smart applies natural language processing (NLP), Best-First Search, and inference.
The processes of SMART are invoked by instantiating the variables of smart/1
, smart:input/1
, and smart:analyze/1
. In turn, the predicates of output result in calls to parsing and forming words, inference to analyze input, as well as values resulting from the Best-First Search.
The operator -:-/2
is defined by :-op(1000,xfy,-:-).
. This operator is a recursive function in two respects: it is a recursive read/write function treating elements of the source file as points of the lattice within the Best-First Search algorithm, and also has calls that are recursive as the operator accesses the streamed input.
smart:input/1
calls input/1
leading immediately to inference. Additional inference results when smart:input/1
calls start/0
, giving streaming input to the parse functions. It also serves as a call to learning.
By calling input/1
, the goal becomes parsing unknown input via classifying input as a function of ideas considered as either a question or command, and following classification append a file with what has been learned.
The output functions again result as sub-processes given by smart:input/1
calling input/1
. The output is parallel to streaming input, parsing, appending a file with the input, and processing the text and sound as context overall.
After identifying input as semantic input, semantic_input/0
is called. semantic_input/1
and semantic_input/3
tie to output phrase/3
. phrase/3
is defined by the SWI Prolog documentation:
The SWI-Prolog implementation of phrase/3 verifies that the List and Rest arguments are unbound, bound to the empty list or a list cons cell. Other values raise a type error. The predicate call_dcg/3 is provided to use grammar rules with terms that are not lists.
The parser is both predicate and module. There are three parse predicates of arity 1, 2, and 3. parse/1
calls parse/3
as a function of parse/1 -> output/1
. parse/1
and parse/2
both call input/3
, meaning/3
. meaning/3
, importantly, is an algorithm for learning as a function of calls.
The module calls, recursively, a lib_dir that is expanded into an atomic list which is then concatenated. From the documentation:
atomic_list_concat(+List, -Atom) [commons] List is a list of strings, atoms, integers, floating point numbers or non-integer rationals. Succeeds if Atom can be unified with the concatenated elements of List. Equivalent to atomic_list_concat(List,’’, Atom).
The iterations of reading lib_dir files assist in the Best-First Search.
To construct nodes to be weighted, a lattice and matrix are formed and expanded.
Given each node is an atomic variable, it may be called within the atomic list which in turn allows strings corresponding to nodes.
The learning and inference comes from the parameters of f/2
, h/2
, t/3
, l/3
, and s/3
from within the lattice created by lattice:bestf/2
. The values are atomic variables that are concatenated as they are searched.
streaming input occurs under the predicate stream_input/0
. A large dependency of this predicate is start/0
which allows inference under the context of streaming input.
pass/0
is called by the module lattice:expand/6
under ~/1
which comes from:
~(pass):-not(pass).
~(pass):-set_random(number).
~(P):-!,(fail),not(P);true.
pass/1
is also called by pass/0
and iterates recursively through lib_dir
, finding the user_source_file/1
, filtering, expanding absolute_file_name/2
, and appending atomic_list_concat/2
.