A little documentation for RuleMatcher.

This commit is contained in:
Fedor Isakov 2019-09-23 17:43:14 +02:00
parent d5bdcc971f
commit 6b2a14511f
2 changed files with 10 additions and 1 deletions

View File

@ -20,7 +20,10 @@ import jetbrains.mps.logic.reactor.core.internal.RuleMatcherImpl
import jetbrains.mps.logic.reactor.program.Rule
/**
* Abstracts a rule matching algorithm.
* Abstracts a rule matching algorithm.
*
* A RuleMatcher corresponds to a single rule.
* The method [probe] provides a factory of [RuleMatchingProbe], which is the main handler of match operations.
*
* @author Fedor Isakov
*/

View File

@ -36,6 +36,12 @@ fun IntArray.toSignature() = TIntArrayList(this)
/**
* This implementation of [RuleMatcher] is based on a simple algorithm which enumerates all possible
* permutations of occurrences potentially matching the rule's head.
*
* Optimizations are in place to cut out permutations that don't fit for the reason that the arguments are mismatched
* and/or logical variables are not unifiable with the substitutions calculated previously.
*
* @author Fedor Isakov
*/
internal class RuleMatcherImpl(private val ruleLookup: RuleLookup,