-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_m_n.js
32 lines (27 loc) · 1.14 KB
/
gen_m_n.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
var _gen = require('./gen.js'),
genNoDup = _gen.genNoDup;
var _parse = require('./parse.js'),
unparse = _parse.unparse;
const varCount = 3;
const depth = 6;
const name = `generated_${varCount}_${depth}`;
var vars = [];
for (var i = 0; i < varCount; i++) { vars.push("a" + i); }
console.log(`var ${name} = [`);
for (let exp of genNoDup(vars, 6)) {
const ue = unparse(exp)
if (ue == "((λ_0 (_0 _0)) (λ_1 (_1 _1)))") continue;
if (ue == "(λ_0 ((λ_1 (_1 _1)) (λ_2 (_2 _2))))") continue;
if (ue == "((λ_0 (_0 _0)) (λ_1 (λ_2 (_1 _1))))") continue;
if (ue == "((λ_0 (_0 _0)) (λ_1 (λ_2 (_1 _1))))") continue;
if (ue == "((λ_0 (_0 _0)) (λ_1 (_1 (_1 _1))))") continue;
if (ue == "((λ_0 (_0 _0)) (λ_1 ((_1 _1) _1)))") continue;
if (ue == "((λ_0 (λ_1 (_0 _0))) (λ_2 (_2 _2)))") continue;
if (ue == "((λ_0 (_0 (_0 _0))) (λ_1 (_1 _1)))") continue;
if (ue == "((λ_0 ((_0 _0) _0)) (λ_1 (_1 _1)))") continue;
// needs rename: ((λ_0 (_0 _0)) (λ_1 (λ_2 (_1 _2))))
console.log(" " + JSON.stringify(exp) + ",");
}
console.log("];");
console.log(`exports.${name} = ${name};`);