abstract-algorithm
Advanced tools
Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "abstract-algorithm", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "Abstract-algorithm for optional reduction of stratifiable lambda terms", | ||
"main": "src/abstract-algorithm.js", | ||
"bin": { | ||
"absal": "src/main.js" | ||
}, | ||
"scripts": { | ||
@@ -26,4 +29,5 @@ "test": "node test.js" | ||
"dependencies": { | ||
"factor": "0.0.1", | ||
"lambda-calculus": "^1.0.6" | ||
} | ||
} |
@@ -48,3 +48,3 @@ // Implements symmetric interaction combinators with infinite node colors. | ||
var prev, next, back; | ||
net.stats = {loops: 0, rewrites: 0}; | ||
net.stats = {loops: 0, rewrites: 0, betas: 0, dupls: 0, annis: 0}; | ||
while (visit.length > 0) { | ||
@@ -61,4 +61,7 @@ ++net.stats.loops; | ||
++net.stats.rewrites; | ||
if (kind(net.mem, node(next)) === 1 && kind(net.mem, node(prev)) === 1) { | ||
++net.stats.betas; | ||
} | ||
back = flip(net.mem, Wire(node(next), meta(net.mem, node(next)))); | ||
rewrite(net.mem, node(next), node(prev)); | ||
rewrite(net.mem, node(next), node(prev), net.stats); | ||
visit.push(flip(net.mem, back)); | ||
@@ -86,3 +89,3 @@ } else { | ||
// you inevitably reduce redexes which do not influence on the normal form. | ||
function rewrite(mem, x, y) { | ||
function rewrite(mem, x, y, stats) { | ||
if (kind(mem,x) === kind(mem,y)){ | ||
@@ -96,2 +99,3 @@ // a b a b | ||
link(mem, flip(mem, Wire(x, 2)), flip(mem, Wire(y, 2))); | ||
++stats.annis; | ||
} else { | ||
@@ -113,2 +117,3 @@ // a d a - B --- A - d | ||
link(mem, flip(mem, Wire(x2, 2)), flip(mem, Wire(y2, 2))); | ||
++stats.dupls; | ||
} | ||
@@ -115,0 +120,0 @@ } |
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
1878423
39
2099
2
5
3
+ Addedfactor@0.0.1
+ Addedfactor@0.0.1(transitive)