eyeling 1.6.4 → 1.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/eyeling.js +11 -9
  2. package/package.json +1 -1
package/eyeling.js CHANGED
@@ -3024,10 +3024,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen) {
3024
3024
  s2[g.o.name] = lit;
3025
3025
  return [s2];
3026
3026
  }
3027
- if (g.o instanceof Literal && g.o.value === lit.value) {
3028
- return [{ ...subst }];
3029
- }
3030
- return [];
3027
+ const s2 = unifyTerm(g.o, lit, subst);
3028
+ return s2 !== null ? [s2] : [];
3031
3029
  }
3032
3030
  }
3033
3031
 
@@ -3078,9 +3076,8 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen) {
3078
3076
  s2[g.o.name] = durTerm;
3079
3077
  return [s2];
3080
3078
  }
3081
- if (g.o instanceof Literal && g.o.value === durTerm.value) {
3082
- return [{ ...subst }];
3083
- }
3079
+ const s2 = unifyTerm(g.o, durTerm, subst);
3080
+ return s2 !== null ? [s2] : [];
3084
3081
  }
3085
3082
  return [];
3086
3083
  }
@@ -3098,9 +3095,14 @@ function evalBuiltin(goal, subst, facts, backRules, depth, varGen) {
3098
3095
  s2[g.o.name] = new Literal(formatNum(c));
3099
3096
  return [s2];
3100
3097
  }
3101
- if (g.o instanceof Literal && g.o.value === formatNum(c)) {
3102
- return [{ ...subst }];
3098
+ const lit = new Literal(formatNum(c));
3099
+ if (g.o instanceof Var) {
3100
+ const s2 = { ...subst };
3101
+ s2[g.o.name] = lit;
3102
+ return [s2];
3103
3103
  }
3104
+ const s2 = unifyTerm(g.o, lit, subst);
3105
+ return s2 !== null ? [s2] : [];
3104
3106
  }
3105
3107
  return [];
3106
3108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eyeling",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "A minimal Notation3 (N3) reasoner in JavaScript.",
5
5
  "main": "./index.js",
6
6
  "keywords": [