Skip to content

Commit 10b4cf9

Browse files
committed
Add Connective as type of arg and add exports
1 parent b4c8697 commit 10b4cf9

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ fol-types
22
=========
33

44
[![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)
5+
![NPM Version](https://img.shields.io/npm/v/@openreasoning/fol-types.svg)

index.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
class Symbol {
1+
export class Symbol {
22
value: string;
33

44
constructor(value: string) {
55
this.value = value;
66
}
77
}
88

9-
type StringSymbol = string | Symbol;
9+
type ConnectiveUnion = Connective | Symbol | string;
1010

11-
class Connective {
11+
export class Connective {
1212
arity: number;
13-
args: Symbol[] = [];
13+
args: (Connective | Symbol)[] = [];
1414

15-
constructor(...args: (StringSymbol)[]) {
16-
args.forEach((arg: StringSymbol) => {
15+
constructor(...args: (ConnectiveUnion)[]) {
16+
args.forEach((arg: ConnectiveUnion) => {
1717
if (typeof arg === 'string') {
1818
arg = new Symbol(arg);
1919
}
@@ -23,32 +23,32 @@ class Connective {
2323
}
2424
}
2525

26-
class Not extends Connective {
27-
constructor(arg: StringSymbol) {
26+
export class Not extends Connective {
27+
constructor(arg: ConnectiveUnion) {
2828
super(arg);
2929
}
3030
}
3131

32-
class And extends Connective {
33-
constructor(arg1: StringSymbol, arg2: StringSymbol) {
32+
export class And extends Connective {
33+
constructor(arg1: ConnectiveUnion, arg2: ConnectiveUnion) {
3434
super(arg1, arg2);
3535
}
3636
}
3737

38-
class Or extends Connective {
39-
constructor(arg1: StringSymbol, arg2: StringSymbol) {
38+
export class Or extends Connective {
39+
constructor(arg1: ConnectiveUnion, arg2: ConnectiveUnion) {
4040
super(arg1, arg2);
4141
}
4242
}
4343

44-
class If extends Connective {
45-
constructor(arg1: StringSymbol, arg2: StringSymbol) {
44+
export class If extends Connective {
45+
constructor(arg1: ConnectiveUnion, arg2: ConnectiveUnion) {
4646
super(arg1, arg2);
4747
}
4848
}
4949

50-
class Iff extends Connective {
51-
constructor(arg1: StringSymbol, arg2: StringSymbol) {
50+
export class Iff extends Connective {
51+
constructor(arg1: ConnectiveUnion, arg2: ConnectiveUnion) {
5252
super(arg1, arg2);
5353
}
5454
}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openreasoning/fol-types",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Types of First-Order Logic formula",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)