 |
Exercise 16: Implement SolveCondition
Summary
Inputs:
  | A rule condition with 1 or more variable tokens. |
  | A hash which defines the values of zero or more variables. |
  | The current token position. |
Outputs:
  | A list of hashes. Each hash represents a set of variable values that satisfies the condition. |
Algorithm:
  | Tokens are processed from left to right. |
  | Non-variable tokens are skipped over. |
  | Each variable which is found to exist in the variable hash should have its value substituted. |
  | Each unknown variable token needs to be solved. This list of possible entities is used to permute the variable hash into N new hashes. For each hash, the function recurses. |
 |   | This subroutine should not be called for relationships with two variables. |
  | The output of a recurse is a list of hashes. Each of these hashes represents part of the final output of the function. |
|
|
 |