A Logic Engine written in TypeScript
npm install tslogicA Logic Engine written in TypeScript
Discover the release history by heading on over to the releases page.
bash
npm install tslogic
`
2. Import:
`typescript
import { default as L } from 'tslogic';
`
3. Logic away:
`typescript
let a = new L.Statement();
let b = new L.Statement();
let impl = new L.BinaryOperator((v) => {return (!v[0]) || v[1];});
let exp = new L.Expression([new L.Atom(a), new L.Atom(b)], impl);
let env = new L.Environment([[a, true], [b, false]]);
exp.value(env); // true
`
Manual coming soon (maybe).To Help Develop:
Currently a private repo.
1. Clone the repository (_git_ required):
`bash
cd MY_PROJECTS
git clone https://github.com/trharley/tslogic.git
`
2. Install dependencies and development-dependencies (_npm_ required):
`bash
cd tslogic/
npm install
`
- Tests are run:
`bash
npm test
`
- To transpile the TS into JS (not necessary for testing):
`bash
npm run-script build
`
the output goes into lib/.
- To generate documentation:
`bash
npm run-script builddocs
``