Skip to content

Commit b4c8697

Browse files
committed
Initial commit
0 parents  commit b4c8697

9 files changed

+210
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist/

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tsconfig.json
2+
*.ts

.travis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
language: node_js
2+
node_js:
3+
- '8'
4+
- '10'
5+
- stable
6+
7+
cache:
8+
directories:
9+
- node_modules
10+
11+
install:
12+
- npm install
13+
script:
14+
- node_modules/.bin/tsc
15+
16+
deploy:
17+
provider: npm
18+
19+
api_key:
20+
secure: dbNYjIdzu0DtGtQLMofWFlBkU0o544NuvOB8QkVx6gR+kr1r/5G32FBlTGcZy4F47g/4ks2iIwm7ftLsdzIBaduTyRZDgWLoBRxryv6VX/tRK9pFD3MZBOuYlLD4iRdiO1T0iXKUOk177QGjvvQ44gVGqILzfz3NSLpqhIIP3R7rFIEuYAf1mFmZvwwurFVB4go+o4yoNNry7PZek+1qPNJhUK0INEdomknieTKbqaB7iEa/0IMX35ZZDk8HgUvXgx/z/dF+ilgdJxYKrjDbEi2hQz4rjFQ6RIbss7Fic0mpNDbbMDEHNjtmElr8KU4kT3UholTiyCmWRzMl/xrb3sogRZVbhi6RuxYCPTt3dCva4oswIpgGRM0v49sNnusYTZ3jYRyNUTuVaKWGTpKutmjJX50/4sIBO8KQDhlEyQv1UeTYIVRIiHl+L6oYdTDQV3c0Q8pLLeqy5/Wlr5eCWx2zPYlQZHnYYSl+c2hrjWbp1xLpAwXOcBxfACzv6BQKKnuSdE0/XtuYev7cKsWk68D+3SBLQk2CEOShaO2LzdgNmIBam0QBvUgVzoIjNpgcn9NxoWDHKr+D7GToKVmLGQLOrePKbou5S6FTfaTLl3m1Xikd2MMEMDd/k3/axosPcJ51XgW7O5OMJSC5V9cKRZ2Cb98lawVS8rwkjQQGUHk=
21+
on:
22+
tags: true
23+
node_js: '10'
24+
repo: OpenReasoning/fol-types-js

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Matthew Peveler
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fol-types
2+
=========
3+
4+
[![Build Status](https://travis-ci.com/OpenReasoning/fol-types-js.svg?branch=master)](https://travis-ci.com/OpenReasoning/fol-types-js)
5+
![npm (scoped)](https://img.shields.io/npm/v/openreasoning/fol-types.svg)

index.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
class Symbol {
2+
value: string;
3+
4+
constructor(value: string) {
5+
this.value = value;
6+
}
7+
}
8+
9+
type StringSymbol = string | Symbol;
10+
11+
class Connective {
12+
arity: number;
13+
args: Symbol[] = [];
14+
15+
constructor(...args: (StringSymbol)[]) {
16+
args.forEach((arg: StringSymbol) => {
17+
if (typeof arg === 'string') {
18+
arg = new Symbol(arg);
19+
}
20+
this.args.push(arg);
21+
});
22+
this.arity = this.args.length;
23+
}
24+
}
25+
26+
class Not extends Connective {
27+
constructor(arg: StringSymbol) {
28+
super(arg);
29+
}
30+
}
31+
32+
class And extends Connective {
33+
constructor(arg1: StringSymbol, arg2: StringSymbol) {
34+
super(arg1, arg2);
35+
}
36+
}
37+
38+
class Or extends Connective {
39+
constructor(arg1: StringSymbol, arg2: StringSymbol) {
40+
super(arg1, arg2);
41+
}
42+
}
43+
44+
class If extends Connective {
45+
constructor(arg1: StringSymbol, arg2: StringSymbol) {
46+
super(arg1, arg2);
47+
}
48+
}
49+
50+
class Iff extends Connective {
51+
constructor(arg1: StringSymbol, arg2: StringSymbol) {
52+
super(arg1, arg2);
53+
}
54+
}

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "@openreasoning/fol-types",
3+
"version": "0.0.1",
4+
"description": "Types of First-Order Logic formula",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"scripts": {
8+
"test": "echo \"Error: no test specified\" && exit 1"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/OpenReasoning/fol-types-js.git"
13+
},
14+
"keywords": [
15+
"fol"
16+
],
17+
"author": "Matthew Peveler <[email protected]>",
18+
"license": "MIT",
19+
"bugs": {
20+
"url": "https://github.com/OpenReasoning/fol-types-js/issues"
21+
},
22+
"homepage": "https://github.com/OpenReasoning/fol-types-js#readme",
23+
"devDependencies": {
24+
"typescript": "^3.4.5"
25+
}
26+
}

tsconfig.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"compilerOptions": {
3+
/* Basic Options */
4+
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
5+
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
6+
// "lib": [], /* Specify library files to be included in the compilation. */
7+
// "allowJs": true, /* Allow javascript files to be compiled. */
8+
// "checkJs": true, /* Report errors in .js files. */
9+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
10+
"declaration": true, /* Generates corresponding '.d.ts' file. */
11+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
12+
"sourceMap": true, /* Generates corresponding '.map' file. */
13+
// "outFile": "./", /* Concatenate and emit output to single file. */
14+
"outDir": "./dist", /* Redirect output structure to the directory. */
15+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
16+
// "composite": true, /* Enable project compilation */
17+
// "incremental": true, /* Enable incremental compilation */
18+
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
19+
// "removeComments": true, /* Do not emit comments to output. */
20+
// "noEmit": true, /* Do not emit outputs. */
21+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
22+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
24+
25+
/* Strict Type-Checking Options */
26+
"strict": true, /* Enable all strict type-checking options. */
27+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
28+
// "strictNullChecks": true, /* Enable strict null checks. */
29+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
30+
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
31+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34+
35+
/* Additional Checks */
36+
// "noUnusedLocals": true, /* Report errors on unused locals. */
37+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
38+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
39+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
40+
41+
/* Module Resolution Options */
42+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
43+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
44+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
45+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
46+
// "typeRoots": [], /* List of folders to include type definitions from. */
47+
// "types": [], /* Type declaration files to be included in compilation. */
48+
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
49+
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
50+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
51+
52+
/* Source Map Options */
53+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
54+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
55+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
56+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
57+
58+
/* Experimental Options */
59+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
60+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
61+
}
62+
}

0 commit comments

Comments
 (0)