opencog/opencog — pull request #742 by cosmoharrigan (2014-05-13 05:52:42+00:00)
Title: Provide a SingleImplicator interface for the pattern matcher that finds one result and then stops

* C++ interface: **Handle PatternSCM::do_single_bindlink(Handle h)**

* Scheme interface: **(cog-bind-single pattern-to-match)**

Defines a **SingleImplicator** **Implicator** containing an implementation of the **solution** method that terminates the pattern matcher after the first match is found.

This functionality can be useful for the upcoming implementation of a generic chainer that is designed to perform incremental steps of one or few inferences per step guided by attention allocation, rather than performing all possible instances against a pattern at once.

Unit test defined in tests/query/BindUTest.cxxtest

Using the pattern matcher over and over in this way may bring up the topic of efficiency, memoization and user-defined indexes that @linas mentioned recently
https://groups.google.com/d/msg/opencog/9OGGkaM6ah8/VXkseMP2XO8J
http://wiki.opencog.org/w/Unified_rule_engine#Current_plans
which we may want to discuss as needed.