-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (23 loc) · 740 Bytes
/
Copy pathindex.js
File metadata and controls
28 lines (23 loc) · 740 Bytes
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
"use strict";
const generic = require("./generic");
const abstract = require("./abstract");
const closed = require("./closed");
const optimal = require("./optimal");
const standard = require("./standard");
const map = new Map();
const expand = generic.expand;
const readback = generic.readback;
const encode = algo => term => {
const expanded = expand(term);
const eqns = algo(generic, expanded);
const conf = eqns.join(";\n") + ";";
let inet = eqns.inet;
inet = inet.replace("INCONFIG", conf);
inet = inet.replace("READBACK\n", readback);
return inet;
};
map.set("abstract", encode(abstract));
map.set("closed", encode(closed));
map.set("optimal", encode(optimal));
map.set("standard", encode(standard));
module.exports = map;