fas-js 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +674 -674
- package/README.md +177 -164
- package/lib/.gitkeep +0 -0
- package/lib/bundle.js +12 -1
- package/lib/bundle.js.map +1 -0
- package/lib/index.cjs +644 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +39 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.js +616 -0
- package/lib/index.js.map +1 -0
- package/package.json +74 -80
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/globals/errors.ts","../src/components/State.ts","../src/globals/globals.ts","../src/components/Alphabet.ts","../src/components/NFATransition.ts","../src/components/Transition.ts","../src/utils/DFAUtils.ts","../src/utils/NFAUtils.ts","../src/utils/FSAUtils.ts","../src/automata/DFA.ts","../src/automata/NFA.ts","../src/engine/Simulators.ts"],"sourcesContent":["export const ErrorCode: Readonly<Record<string, string>> = Object.freeze({\n DUPLICATE_ALPHABET_VALS: \"E-001\",\n DUPLICATE_STATE_NAMES: \"E-002\",\n INVALID_STATE_NAME: \"E-003\",\n START_STATE_NOT_FOUND: \"E-004\",\n ACCEPTS_NOT_SUBSET: \"E-005\",\n ORIGIN_STATE_NOT_FOUND: \"E-006\",\n DEST_STATE_NOT_FOUND: \"E-007\",\n MISSING_REQUIRED_TRANSITION: \"E-008\",\n INVALID_INPUT_CHAR: \"E-009\",\n INPUT_STATE_NOT_FOUND: \"E-010\",\n INVALID_TRANSITION_OBJECT: \"E-011\",\n DUPLICATE_TRANSITION_OBJECT: \"E-012\",\n INVALID_STATE_ARRAY: \"E-013\"\n});","import { ErrorCode } from \"../globals/errors\";\n\nexport class State {\n name: string;\n\n constructor(name: string) {\n this.name = name;\n if (!this.name) throw new Error(ErrorCode.INVALID_STATE_NAME);\n }\n}","import { State } from \"../components/State\";\n\n// Count number of instances for each string in an array - returns key/val pairs\nexport const count = (names: string[]): Record<string, number> =>\n names.reduce((a, b) => Object.assign(a, { [b]: (a[b] || 0) + 1 }), {} as Record<string, number>);\n\n// Returns keys with value > 1\nexport const duplicates = (dict: Record<string, number>): string[] =>\n Object.keys(dict).filter(a => dict[a] > 1);\n\n// Equality function for Arrays containing primitive typed values\nexport const compare = (\n a1: Array<string | number | boolean>,\n a2: Array<string | number | boolean>\n): boolean => {\n const s1 = new Set(a1);\n const s2 = new Set(a2);\n return s1.size === s2.size && [...s1].every(v => s2.has(v));\n};\n\n// Check for duplicate keys in a Set<State> input\nexport const checkStateDuplicates = (states: Set<State>): boolean => {\n const check: Set<string> = new Set();\n for (const item of states) {\n if (check.has(item.name)) return true;\n check.add(item.name);\n }\n return false;\n};\n\nexport const getOrDefault = <K, V>(map: Map<K, V>, key: K, defaultValue: V): V => {\n const val = map.get(key);\n return val == null ? defaultValue : val;\n};\n\nexport const instanceOf = (ctor: Function, obj: object): boolean => {\n return obj instanceof ctor || (Boolean(ctor.name) && ctor.name === obj.constructor.name);\n};\n\nexport const isSubsetOf = <T>(subset: Set<T>, superset: Set<T>): boolean => {\n for (const item of subset) {\n if (!superset.has(item)) return false;\n }\n return true;\n};\n\nexport const isSupersetOf = <T>(superset: Set<T>, subset: Set<T>): boolean => {\n return isSubsetOf(subset, superset);\n};","import { ErrorCode } from \"../globals/errors\";\nimport { count, duplicates } from \"../globals/globals\";\n\nexport class Alphabet {\n sigma: string[];\n\n constructor(sigma: string | string[]) {\n if (!Array.isArray(sigma)) {\n if (typeof sigma === \"string\") sigma = [...sigma];\n else throw new TypeError();\n }\n this.sigma = sigma;\n if (duplicates(count(this.sigma)).length > 0) throw new Error(ErrorCode.DUPLICATE_ALPHABET_VALS);\n }\n}","import { State } from \"./State\";\n\nexport class NFATransition {\n origin: State;\n dest: State[];\n input: string;\n\n constructor(origin: State, dest: State[], input: string) {\n this.origin = origin;\n this.dest = dest;\n this.input = input;\n }\n}","import { State } from \"./State\";\n\nexport class Transition {\n origin: State;\n dest: State;\n input: string;\n\n constructor(origin: State, dest: State, input: string) {\n this.origin = origin;\n this.dest = dest;\n this.input = input;\n }\n}","import { ErrorCode } from \"../globals/errors\";\nimport { State, Alphabet, Transition } from \"../components\";\nimport { DFA } from \"../automata\";\nimport { getOrDefault } from \"../globals/globals\";\n\nexport class DFAUtils {\n /*\n * Transition function should only contain states in Q, and one transition should exist\n * for each combination of Q x Σ\n */\n static validateTFunc(\n _states: Set<State>,\n _paths: Map<State, Set<string>>,\n _tfunc: Set<Transition>,\n _alph: Alphabet\n ): Set<Transition> {\n const newTFunc: Set<Transition> = new Set(); // Will contain only necessary transitions\n\n for (const _t of _tfunc) {\n // Check for valid states\n if (!_states.has(_t.origin)) {\n console.error(\"Origin state was invalid: %o\", JSON.stringify(_t.origin));\n throw new Error(ErrorCode.ORIGIN_STATE_NOT_FOUND);\n }\n if (!_states.has(_t.dest)) {\n console.error(\"Dest state was invalid: %o\", JSON.stringify(_t.dest));\n throw new Error(ErrorCode.DEST_STATE_NOT_FOUND);\n }\n\n const pathStateVals: Set<string> = getOrDefault(_paths, _t.origin, new Set());\n\n // Map transition to a path and remove on match\n if (this.isValidInputChar(_t.input, _alph)) {\n if (_paths.has(_t.origin) && pathStateVals.has(_t.input)) {\n newTFunc.add(_t);\n pathStateVals.delete(_t.input);\n if (pathStateVals.size === 0) {\n _paths.delete(_t.origin);\n }\n } else {\n throw new Error(ErrorCode.DUPLICATE_TRANSITION_OBJECT);\n }\n } else {\n throw new Error(ErrorCode.INVALID_INPUT_CHAR);\n }\n }\n\n if (_paths.size > 0) {\n console.error(\"Not all FSA paths have a transition specified:\");\n for (const [key, val] of _paths) {\n console.error(\"State %s on input(s): %s\", key.name, [...val].join(\" \"));\n }\n throw new Error(ErrorCode.MISSING_REQUIRED_TRANSITION);\n }\n\n return newTFunc;\n }\n\n static createPaths(_states: Set<State>, _alph: Alphabet): Map<State, Set<string>> {\n const _paths: Map<State, Set<string>> = new Map<State, Set<string>>();\n for (const state of _states) {\n for (const char of _alph.sigma) {\n const pathStateVals: Set<string> = getOrDefault(_paths, state, new Set());\n if (_paths.has(state)) pathStateVals.add(char);\n else _paths.set(state, new Set([char]));\n }\n }\n\n return _paths;\n }\n\n // Determine digraph order based on start state, then following the chain\n static determineStateOrder(\n _links: Map<string, Set<string>>,\n _tfunc: Set<Transition>,\n _states: Set<State>,\n _start: State,\n _accepts: Set<State>\n ): string[] {\n const statesOrder: string[] = []; // Ordered state names for digraph\n\n // Map origin state names to dest state names\n _links = new Map();\n for (const tr of _tfunc) {\n const linkStateVals: Set<string> = getOrDefault(_links, tr.origin.name, new Set());\n if (_links.has(tr.origin.name)) linkStateVals.add(tr.dest.name);\n else _links.set(tr.origin.name, new Set([tr.dest.name]));\n }\n\n // Populate state order\n this.parseLinks(statesOrder, _start.name, _links);\n\n // Check for dead states and reduce FSA if necessary\n const stateArr: string[] = [];\n (Object.values([..._states]) as State[]).map((state: State) => stateArr.push(state.name));\n const deadStates = stateArr.filter(x => !statesOrder.includes(x));\n if (deadStates.length > 0) {\n console.warn(\"Dead states detected, removing them and associated transitions: %O\", deadStates);\n this.removeDeadStates(deadStates, _states, _accepts, _tfunc);\n }\n\n return statesOrder;\n }\n\n // Reduce FSA by removing dead states and associated transitions\n static removeDeadStates(\n deadStates: string[],\n _states: Set<State>,\n _accepts: Set<State>,\n _tfunc: Set<Transition>\n ) {\n // Q\n for (const state of _states) {\n if (deadStates.indexOf(state.name) !== -1) _states.delete(state);\n }\n // F\n for (const state of _accepts) {\n if (deadStates.indexOf(state.name) !== -1) _accepts.delete(state);\n }\n // δ\n for (const tr of _tfunc) {\n if (deadStates.indexOf(tr.origin.name) !== -1 || deadStates.indexOf(tr.dest.name) !== -1) _tfunc.delete(tr);\n }\n }\n\n // Recursively parse graph while adding to an array in order, beginning with q0\n static parseLinks(arr: string[], name: string, _links: Map<string, Set<string>>) {\n arr.push(name);\n const nameVal = getOrDefault(_links, name, new Set<string>());\n for (const st of nameVal) {\n if (arr.indexOf(st) === -1) this.parseLinks(arr, st, _links);\n }\n }\n\n // DFA does not allow empty symbol\n static isValidInputChar(input: string, _alph: Alphabet): boolean {\n if (input === \"\") return false;\n return _alph.sigma.indexOf(input) !== -1;\n }\n}\n\nexport interface TransitionInput {\n from: string;\n to: string;\n input: string;\n}\n\n// Global export method for creating DFA\nexport const createDFA = (\n states: Map<string, State>,\n alphabet: Alphabet,\n transitions: TransitionInput[],\n start: State,\n accepts: Set<State>\n): InstanceType<typeof DFA> => {\n // Convert transition array to Set<Transition>\n const _tfunc: Set<Transition> = new Set();\n for (const tr of transitions) {\n if (!tr.from || !tr.to || !tr.input) throw new Error(ErrorCode.INVALID_TRANSITION_OBJECT);\n const fromVal: State = getOrDefault(states, tr.from, null as unknown as State);\n const toVal: State = getOrDefault(states, tr.to, null as unknown as State);\n _tfunc.add(new Transition(fromVal, toVal, tr.input));\n }\n return new DFA(new Set(states.values()), alphabet, _tfunc, start, accepts);\n};","import { DFAUtils } from \"./DFAUtils\";\nimport { NFA } from \"../automata\";\nimport { State, Transition, Alphabet, NFATransition } from \"../components\";\nimport { ErrorCode } from \"../globals/errors\";\nimport { getOrDefault } from \"../globals/globals\";\nimport type { TransitionInput } from \"./DFAUtils\";\n\nexport class NFAUtils extends DFAUtils {\n // NFA inheritly allows for ε (empty string) transition if specified\n static isValidInputChar(input: string, _alph: Alphabet): boolean {\n return _alph.sigma.indexOf(input) !== -1 || input === \"\";\n }\n\n // Follow all ε transitions and add to `state` (origin states)\n static populateEpsilons(_tfunc: Set<Transition>, state: State[]): State[] {\n let cont = true; // continue\n while (cont) {\n cont = false;\n\n // Find all ε from origin set\n const epsTransitions: Transition[] = Array.from(_tfunc).filter(obj => {\n return state.includes(obj.origin) && obj.input === \"\";\n });\n\n // Add new states, break if no new states found\n for (const _t of epsTransitions) {\n if (!state.includes(_t.dest)) {\n state.push(_t.dest);\n cont = true;\n }\n }\n }\n return state;\n }\n\n // Validate tfunc according to NFA rules\n static validateTFunc(\n _states: Set<State>,\n _paths: Map<State, Set<string>>,\n _tfunc: Set<Transition>,\n _alph: Alphabet\n ): Set<Transition> {\n const newTFunc: Set<Transition> = new Set(); // Will contain only necessary transitions\n\n for (const _t of _tfunc) {\n let skip = false;\n\n // Check for valid states\n if (!_states.has(_t.origin)) {\n console.error(\"Origin state was invalid: %o\", JSON.stringify(_t.origin));\n throw new Error(ErrorCode.ORIGIN_STATE_NOT_FOUND);\n }\n if (!_states.has(_t.dest)) {\n console.error(\"Dest state was invalid: %o\", JSON.stringify(_t.dest));\n throw new Error(ErrorCode.DEST_STATE_NOT_FOUND);\n }\n\n const pathStateVals: Set<string> = getOrDefault(_paths, _t.origin, new Set());\n\n // Check for duplicate before adding\n for (const _checkT of newTFunc) {\n if (_checkT.origin === _t.origin && _checkT.dest === _t.dest && _checkT.input === _t.input) skip = true;\n }\n\n // Map transition to a path and remove on match\n if (!skip) {\n if (_paths.has(_t.origin)) {\n if (this.isValidInputChar(_t.input, _alph)) {\n newTFunc.add(_t);\n } else {\n throw new Error(ErrorCode.INVALID_INPUT_CHAR);\n }\n }\n }\n }\n\n return newTFunc;\n }\n}\n\nexport const createNFA = (\n states: Map<string, State>,\n alphabet: Alphabet,\n transitions: TransitionInput[],\n start: State,\n accepts: Set<State>\n): InstanceType<typeof NFA> => {\n // Convert transition array to Set<NFATransition>\n const _tfunc: Set<NFATransition> = new Set();\n for (const tr of transitions) {\n if (!tr.from || !tr.to || (!tr.input && tr.input !== \"\"))\n throw new Error(ErrorCode.INVALID_TRANSITION_OBJECT);\n const fromVal: State = getOrDefault(states, tr.from, null as unknown as State);\n const toVal: string[] = tr.to.split(\",\");\n\n const destStates: State[] = [];\n toVal.forEach(_dest => {\n destStates.push(getOrDefault(states, _dest, null as unknown as State));\n });\n\n _tfunc.add(new NFATransition(fromVal, destStates, tr.input));\n }\n return new NFA(new Set(states.values()), alphabet, _tfunc, start, accepts);\n};","import { ErrorCode } from \"../globals/errors\";\nimport { instanceOf, getOrDefault } from \"../globals/globals\";\nimport { FSA } from \"../interfaces/FSA\";\nimport { State, Transition, Alphabet } from \"../components\";\nimport { DFA, NFA } from \"../automata\";\nimport { DFAUtils, createDFA, type TransitionInput } from \"./DFAUtils\";\nimport { NFAUtils, createNFA } from \"./NFAUtils\";\n\nexport type { TransitionInput };\n\n/*\n * This class will take an input FSA constructor function\n * to determine which util methods need to be called\n */\nexport const FSAUtils = (() => {\n /*\n * Private methods\n */\n function receiveInputDFA(dfa: InstanceType<typeof DFA>, input: string, state: State): State {\n if (dfa.getAlphabet().sigma.indexOf(input) === -1) throw new Error(ErrorCode.INVALID_INPUT_CHAR);\n if (!dfa.getStates().has(state)) throw new Error(ErrorCode.INPUT_STATE_NOT_FOUND);\n\n const path = Array.from(dfa.getTFunc()).find(obj => {\n return obj.origin === state && obj.input === input;\n });\n\n if (path) return path.dest;\n else throw new Error(ErrorCode.INVALID_TRANSITION_OBJECT);\n }\n\n function receiveInputNFA(nfa: InstanceType<typeof NFA>, input: string, state: State[]): Set<State> {\n let path: Transition[] = [];\n if (nfa.getAlphabet().sigma.indexOf(input) === -1) throw new Error(ErrorCode.INVALID_INPUT_CHAR);\n\n // Empty transitions\n state = populateEpsilons(nfa.getTFunc(), state);\n\n // For ε input, return states already determined\n if (input === \"\") return new Set<State>(state);\n\n // Looking at all origin states, based on input char, determine set of destination states\n for (const _s of state) {\n const _addToPath: Transition[] = Array.from(nfa.getTFunc()).filter(obj => {\n return obj.origin === _s && obj.input === input;\n });\n\n path = path.concat(_addToPath);\n }\n\n let resultArr: State[] = [];\n if (path.length > 1) {\n for (const _s of path) resultArr.push(_s.dest);\n } else if (path.length === 1) {\n resultArr.push(path[0].dest);\n } else {\n // No valid transition found, returning empty set\n return new Set<State>();\n }\n\n // Empty transitions on result set\n const retSet: Set<State> = new Set<State>(populateEpsilons(nfa.getTFunc(), resultArr));\n\n return retSet;\n }\n\n function populateEpsilons(_tfunc: Set<Transition>, state: State[]): State[] {\n return NFAUtils.populateEpsilons(_tfunc, state);\n }\n\n class FSAUtils {\n _type: typeof DFA | typeof NFA;\n\n constructor(v: typeof DFA | typeof NFA) {\n this._type = v;\n }\n\n receiveInput(fsa: FSA, input: string, state: State | State[]): State | Set<State> {\n if (instanceOf(NFA, fsa)) {\n if (state instanceof State) return receiveInputNFA(fsa as InstanceType<typeof NFA>, input, [state]);\n else return receiveInputNFA(fsa as InstanceType<typeof NFA>, input, state);\n } else {\n if (Array.isArray(state)) {\n if (state.length > 1) {\n console.error(\"State array can only contain one state for DFAs\");\n throw new Error(ErrorCode.INVALID_STATE_ARRAY);\n } else {\n state = state[0];\n }\n }\n return receiveInputDFA(fsa as InstanceType<typeof DFA>, input, state);\n }\n }\n\n validateTFunc(\n _states: Set<State>,\n _paths: Map<State, Set<string>>,\n _tfunc: Set<Transition>,\n _alph: Alphabet\n ): Set<Transition> {\n if (this._type === NFA) {\n return NFAUtils.validateTFunc(_states, _paths, _tfunc, _alph);\n } else {\n return DFAUtils.validateTFunc(_states, _paths, _tfunc, _alph);\n }\n }\n\n createPaths(_states: Set<State>, _alph: Alphabet): Map<State, Set<string>> {\n return DFAUtils.createPaths(_states, _alph);\n }\n\n determineStateOrder(\n _links: Map<string, Set<string>>,\n _tfunc: Set<Transition>,\n _states: Set<State>,\n _start: State,\n _accepts: Set<State>\n ): string[] {\n return DFAUtils.determineStateOrder(_links, _tfunc, _states, _start, _accepts);\n }\n }\n\n return FSAUtils;\n})();\n\n// Global export method for creating FSA\nexport const createFSA = (\n states: string | string[],\n alphabet: string | string[],\n transitions: TransitionInput | TransitionInput[],\n start: string,\n accepts: string | string[]\n): FSA => {\n // Type check and conversion for states\n const _states: Map<string, State> = new Map();\n if (typeof states === \"string\") {\n _states.set(states, new State(states));\n } else if (Array.isArray(states)) {\n for (const state of states) {\n if (!_states.has(state)) _states.set(state, new State(state));\n }\n } else {\n throw new TypeError(String(states));\n }\n\n // Convert remaining inputs\n const _alphabet = new Alphabet(alphabet);\n if (typeof start !== \"string\") throw new TypeError(String(start));\n const _start: State = getOrDefault(_states, start, null as unknown as State);\n\n const _accepts: Set<State> = new Set();\n if (typeof accepts === \"string\") {\n if (_states.has(accepts)) _accepts.add(getOrDefault(_states, accepts, null as unknown as State));\n } else if (Array.isArray(accepts)) {\n for (const state of accepts) {\n _accepts.add(getOrDefault(_states, state, null as unknown as State));\n }\n } else {\n throw new TypeError(String(accepts));\n }\n\n /*\n * Determine, based on tfunc structure, whether to create a DFA or NFA\n * If the \"to\" field of any member of the tfunc object is comma separated, or any input\n * char is \"\", then create an NFA\n */\n let transitionList: TransitionInput[];\n if (!Array.isArray(transitions) && typeof transitions === \"object\") transitionList = [transitions];\n else if (Array.isArray(transitions)) transitionList = transitions;\n else throw new TypeError(String(transitions));\n\n for (const tr of transitionList) {\n if (tr.to.indexOf(\",\") != -1 || tr.input === \"\")\n return createNFA(_states, _alphabet, transitionList, _start, _accepts);\n }\n return createDFA(_states, _alphabet, transitionList, _start, _accepts);\n};","import { FSA } from \"../interfaces/FSA\";\nimport { State, Alphabet, Transition } from \"../components\";\nimport { ErrorCode } from \"../globals/errors\";\nimport { checkStateDuplicates, getOrDefault, isSubsetOf } from \"../globals/globals\";\nimport { FSAUtils } from \"../utils\";\n\nexport const DFA = (() => {\n class DFA implements FSA {\n // Primary FSA attributes\n #states: Set<State>;\n #alphabet: Alphabet;\n #tfunc: Set<Transition>;\n #start: State;\n #accepts: Set<State>;\n\n // Intermediary attributes used in constructor\n #paths: Map<State, Set<string>>; // States mapped to each member of Σ, will be empty after constructor returns\n #links: Map<string, Set<string>> = new Map(); // State names mapped to their dest state names\n #utils: InstanceType<typeof FSAUtils>;\n\n constructor(\n states: Set<State>,\n alphabet: Alphabet,\n tfunc: Set<Transition>,\n start: State,\n accepts: Set<State> | Record<string, never>\n ) {\n // initialize utils\n this.#utils = new FSAUtils(this.constructor as typeof DFA);\n\n // states validations\n if (checkStateDuplicates(states)) throw new Error(ErrorCode.DUPLICATE_STATE_NAMES);\n this.#states = states;\n\n this.#alphabet = alphabet;\n\n // Create paths map\n this.#paths = this.#utils.createPaths(this.#states, this.#alphabet);\n\n // Start/Accept validations\n if (!states.has(start)) throw new Error(ErrorCode.START_STATE_NOT_FOUND);\n this.#start = start;\n if (Object.keys(accepts).length === 0 && accepts.constructor === Object) accepts = new Set([]); // Allow for {}\n if (!isSubsetOf(accepts as Set<State>, states)) throw new Error(ErrorCode.ACCEPTS_NOT_SUBSET);\n this.#accepts = accepts as Set<State>;\n\n // TFunc validations\n this.#tfunc = this.#utils.validateTFunc(this.#states, this.#paths, tfunc, this.#alphabet);\n }\n\n /*\n * Getters\n */\n getStates(): Set<State> {\n return this.#states;\n }\n getAlphabet(): Alphabet {\n return this.#alphabet;\n }\n getTFunc(): Set<Transition> {\n return this.#tfunc;\n }\n getStartState(): State {\n return this.#start;\n }\n getAcceptStates(): Set<State> {\n return this.#accepts;\n }\n getType(): string {\n return \"DFA\";\n }\n\n generateDigraph(): string {\n // Prep outputs\n const acceptArr: string[] = [];\n for (const state of this.#accepts) acceptArr.push(state.name);\n\n // Duplicate origin/dest combinations should share a line\n const pairs: Map<string, string> = new Map();\n (Object.values([...this.#tfunc]) as Transition[]).map(function (t: Transition) {\n const key: string = t.origin.name + t.dest.name;\n let _input: string = t.input;\n if (_input === \"\") _input = \"ε\";\n if (!pairs.has(key)) {\n pairs.set(key, t.origin.name + \" -> \" + t.dest.name + ' [ label = \"' + _input + '\" ];');\n } else {\n /*\n * To edit an existing line, split out the input(s), convert to number, sort them ascending, and add the new one\n */\n let _line: string = getOrDefault(pairs, key, \"\");\n const _oldinput: string = _line.split('\"')[1];\n const _toAdd: string[] = _oldinput.split(\",\");\n _toAdd.push(_input);\n _toAdd.sort();\n _line = _line.replace('\"' + _oldinput + '\"', '\"' + _toAdd.toString() + '\"');\n pairs.set(key, _line);\n }\n });\n\n // return template literal\n return `digraph fsa {\n ${(Object.values(\n this.#utils.determineStateOrder(this.#links, this.#tfunc, this.#states, this.#start, this.#accepts)\n ) as string[])\n .map(function (str: string) {\n if (acceptArr.indexOf(str) !== -1) return str + \" [shape = doublecircle];\";\n else return str;\n })\n .join(\"\\n\\t\")}\n rankdir=LR;\n node [shape = point ]; qi;\n node [shape = circle];\n qi -> ${this.#start.name};\n ${(Object.values([...pairs]) as [string, string][])\n .map(function ([, val]) {\n return val;\n })\n .join(\"\\n\\t\")}\n }\n `;\n }\n }\n\n return DFA;\n})();","import { DFA } from \"./DFA\";\nimport { State, Alphabet, NFATransition, Transition } from \"../components\";\n\nexport const NFA = (() => {\n class NFA extends DFA {\n // Transition function is different for NFA\n constructor(\n states: Set<State>,\n alphabet: Alphabet,\n tfunc: Set<NFATransition>,\n start: State,\n accepts: Set<State> | Record<string, never>\n ) {\n // Implicitly add ε to alphabet\n if (!alphabet.sigma.includes(\"\")) alphabet.sigma.push(\"\");\n\n // If NFATransition has multiple dest states, break them up into separate Transitions\n const expandedTfunc: Set<Transition> = new Set<Transition>();\n for (const _t of tfunc) {\n _t.dest.forEach(_dest => {\n expandedTfunc.add(new Transition(_t.origin, _dest, _t.input));\n });\n }\n\n super(states, alphabet, expandedTfunc, start, accepts);\n }\n\n getType(): string {\n return \"NFA\";\n }\n }\n\n return NFA;\n})();","import { FSA } from \"../interfaces/FSA\";\nimport { State } from \"../components/State\";\nimport { DFA, NFA } from \"../automata\";\nimport { FSAUtils } from \"../utils\";\nimport { ErrorCode } from \"../globals/errors\";\nimport { instanceOf } from \"../globals/globals\";\n\nexport const simulateFSA = (\n w: string | string[],\n fsa: FSA,\n logging: boolean = false,\n returnEndState: boolean = false\n): boolean | string | string[] => {\n if (instanceOf(NFA, fsa)) {\n return simulateNFA(w, fsa as InstanceType<typeof NFA>, new FSAUtils(NFA), logging, returnEndState);\n } else {\n return simulateDFA(w, fsa as InstanceType<typeof DFA>, new FSAUtils(DFA), logging, returnEndState);\n }\n};\n\nexport const stepOnceFSA = (\n w: string,\n qin: string | string[],\n fsa: FSA,\n logging: boolean = false\n): string | string[] => {\n if (typeof w !== \"string\") {\n if (logging) console.error(\"Input w was invalid type: %O\", w);\n throw new TypeError();\n }\n if (typeof qin !== \"string\" && !Array.isArray(qin)) {\n if (logging) console.error(\"Input state was invalid type: %O\", qin);\n throw new TypeError();\n }\n\n // Step once\n if (logging) console.log(\"Input Processing Started\");\n let prevState: State | State[] = [];\n if (typeof qin === \"string\") {\n for (const state of fsa.getStates().values()) {\n if (qin === state.name) prevState = state;\n }\n if (!prevState || (Array.isArray(prevState) && prevState.length === 0))\n throw new Error(ErrorCode.INVALID_STATE_NAME);\n } else {\n prevState = [];\n for (const state of fsa.getStates().values()) {\n if (qin.includes(state.name)) prevState.push(state);\n }\n if (prevState.length !== qin.length) {\n throw new Error(ErrorCode.INVALID_STATE_NAME);\n }\n }\n\n let newState: State | State[];\n if (instanceOf(NFA, fsa)) newState = [...(new FSAUtils(NFA).receiveInput(fsa, w, prevState) as Set<State>)];\n else newState = new FSAUtils(DFA).receiveInput(fsa, w, prevState) as State;\n\n if (logging) console.log(\"%o x '%s' -> %o\", JSON.stringify(prevState), w, JSON.stringify(newState));\n if (logging) console.log(\"Input Processing Ended\");\n\n if (newState instanceof State) return newState.name;\n else {\n const retArray: string[] = [];\n for (const _s of newState) {\n retArray.push(_s.name);\n }\n return retArray;\n }\n};\n\n/*\n * Private methods\n */\nfunction simulateDFA(\n w: string | string[],\n dfa: InstanceType<typeof DFA>,\n utils: InstanceType<typeof FSAUtils>,\n logging: boolean,\n returnEndState: boolean\n): boolean | string {\n if (logging) console.log(\"Beginning DFA Simulation\");\n\n //Accept either string or string[] for w\n if (!Array.isArray(w)) {\n if (typeof w === \"string\") w = [...w];\n else {\n if (logging) console.error(\"Input w was invalid type: %O\", w);\n throw new TypeError();\n }\n }\n\n // Step through the DFA\n if (logging) console.log(\"Input Processing Started\");\n let currentState: State = dfa.getStartState();\n for (const char of w) {\n const prevState: State = currentState;\n currentState = utils.receiveInput(dfa, char, prevState) as State;\n if (logging) console.log(\"%o x '%s' -> %o\", JSON.stringify(prevState), char, JSON.stringify(currentState));\n }\n if (logging) console.log(\"Input Processing Ended\");\n\n // Check for acceptance\n if (dfa.getAcceptStates().has(currentState)) {\n if (logging) console.log(\"Input Accepted!\");\n if (returnEndState) return currentState.name;\n else return true;\n } else {\n if (logging) console.log(\"Input Rejected!\");\n if (returnEndState) return currentState.name;\n else return false;\n }\n}\n\nfunction simulateNFA(\n w: string | string[],\n nfa: InstanceType<typeof NFA>,\n utils: InstanceType<typeof FSAUtils>,\n logging: boolean,\n returnEndState: boolean\n): boolean | string[] {\n if (logging) console.log(\"Beginning NFA Simulation\");\n\n //Accept either string or string[] for w\n if (!(w instanceof Array)) {\n if (typeof w === \"string\") {\n if (w === \"\") w = [\"\"];\n else w = [...w];\n } else {\n if (logging) console.error(\"Input w was invalid type: %O\", w);\n throw new TypeError();\n }\n }\n\n if (logging) console.log(\"Input Processing Started\");\n let currentState: State[] = [nfa.getStartState()];\n for (const char of w) {\n const prevState: State[] = currentState;\n currentState = [...(utils.receiveInput(nfa, char, currentState) as Set<State>)];\n if (logging) console.log(\"%o x '%s' -> %o\", JSON.stringify(prevState), char, JSON.stringify(currentState));\n }\n if (logging) console.log(\"Input Processing Ended\");\n\n /*\n * Check for acceptance or rejection.\n * If returnEndState:\n * If accept, return all final accept states.\n * If reject, return all final states or if no final state return empty string\n */\n const retObj: string[] = [];\n for (const _accState of nfa.getAcceptStates()) {\n if (currentState.includes(_accState)) {\n if (!returnEndState) {\n if (logging) console.log(\"Input Accepted!\");\n return true;\n }\n retObj.push(_accState.name);\n }\n }\n if (retObj.length > 0) {\n if (logging) console.log(\"Input Accepted!\");\n return retObj;\n }\n\n if (logging) console.log(\"Input Rejected!\");\n if (returnEndState) {\n if (currentState.length > 0) {\n for (const _cState of currentState) retObj.push(_cState.name);\n }\n return retObj;\n } else {\n return false;\n }\n}"],"mappings":";;;;;;;;;AAAO,IAAM,YAA8C,OAAO,OAAO;AAAA,EACvE,yBAAyB;AAAA,EACzB,uBAAuB;AAAA,EACvB,oBAAoB;AAAA,EAC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S,SAAQ,IAAI,wBAAwB;AAQjD,QAAM,SAAmB,CAAC;AAC1B,aAAW,aAAa,IAAI,gBAAgB,GAAG;AAC7C,QAAI,aAAa,SAAS,SAAS,GAAG;AACpC,UAAI,CAAC,gBAAgB;AACnB,YAAI,QAAS,SAAQ,IAAI,iBAAiB;AAC1C,eAAO;AAAA,MACT;AACA,aAAO,KAAK,UAAU,IAAI;AAAA,IAC5B;AAAA,EACF;AACA,MAAI,OAAO,SAAS,GAAG;AACrB,QAAI,QAAS,SAAQ,IAAI,iBAAiB;AAC1C,WAAO;AAAA,EACT;AAEA,MAAI,QAAS,SAAQ,IAAI,iBAAiB;AAC1C,MAAI,gBAAgB;AAClB,QAAI,aAAa,SAAS,GAAG;AAC3B,iBAAW,WAAW,aAAc,QAAO,KAAK,QAAQ,IAAI;AAAA,IAC9D;AACA,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;","names":["FSAUtils","DFA","NFA"]}
|
package/package.json
CHANGED
|
@@ -1,80 +1,74 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "fas-js",
|
|
3
|
-
"description": "Finate State Automata JS Solutions",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"
|
|
6
|
-
"main": "lib/
|
|
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
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
"bugs": {
|
|
53
|
-
"url": "https://github.com/jml6m/fas-js/issues"
|
|
54
|
-
},
|
|
55
|
-
"homepage": "https://github.com/jml6m/fas-js#readme",
|
|
56
|
-
"directories": {
|
|
57
|
-
"lib": "lib",
|
|
58
|
-
"test": "test"
|
|
59
|
-
},
|
|
60
|
-
"keywords": [
|
|
61
|
-
"state-machine",
|
|
62
|
-
"fsa",
|
|
63
|
-
"finite",
|
|
64
|
-
"state",
|
|
65
|
-
"automata",
|
|
66
|
-
"automaton",
|
|
67
|
-
"dfa",
|
|
68
|
-
"ndfa",
|
|
69
|
-
"turing"
|
|
70
|
-
],
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"regenerator-runtime": "^0.13.3"
|
|
76
|
-
},
|
|
77
|
-
"files": [
|
|
78
|
-
"lib/bundle.js"
|
|
79
|
-
]
|
|
80
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "fas-js",
|
|
3
|
+
"description": "Finate State Automata JS Solutions",
|
|
4
|
+
"version": "1.4.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/index.cjs",
|
|
7
|
+
"module": "./lib/index.js",
|
|
8
|
+
"types": "./lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"import": "./lib/index.js",
|
|
13
|
+
"require": "./lib/index.cjs"
|
|
14
|
+
},
|
|
15
|
+
"./bundle": {
|
|
16
|
+
"default": "./lib/bundle.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/jml6m/fas-js.git"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsup",
|
|
25
|
+
"prebuild": "node scripts/prebuild.mjs",
|
|
26
|
+
"postbuild": "node scripts/postbuild.mjs",
|
|
27
|
+
"clean": "node scripts/prebuild.mjs",
|
|
28
|
+
"prepublishOnly": "npm run build && npm test",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"test": "npm run build && cross-env NODE_OPTIONS=--import=tsx c8 mocha \"test/**/*.spec.js\"",
|
|
31
|
+
"audit:ci": "npm audit --audit-level=high",
|
|
32
|
+
"git:reset": "git reset --hard HEAD && git clean -fd",
|
|
33
|
+
"npm:reinstall": "node scripts/reinstall.js"
|
|
34
|
+
},
|
|
35
|
+
"author": "Joseph Lewkovich",
|
|
36
|
+
"license": "GPL-3.0-or-later",
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/chai": "^4.3.20",
|
|
39
|
+
"@types/mocha": "^10.0.10",
|
|
40
|
+
"c8": "^10.1.3",
|
|
41
|
+
"chai": "^4.5.0",
|
|
42
|
+
"cross-env": "^7.0.3",
|
|
43
|
+
"mocha": "^11.7.1",
|
|
44
|
+
"rimraf": "^6.0.1",
|
|
45
|
+
"tsup": "^8.5.0",
|
|
46
|
+
"tsx": "^4.20.3",
|
|
47
|
+
"typescript": "^5.8.3"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"lib"
|
|
51
|
+
],
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/jml6m/fas-js/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/jml6m/fas-js#readme",
|
|
56
|
+
"directories": {
|
|
57
|
+
"lib": "lib",
|
|
58
|
+
"test": "test"
|
|
59
|
+
},
|
|
60
|
+
"keywords": [
|
|
61
|
+
"state-machine",
|
|
62
|
+
"fsa",
|
|
63
|
+
"finite",
|
|
64
|
+
"state",
|
|
65
|
+
"automata",
|
|
66
|
+
"automaton",
|
|
67
|
+
"dfa",
|
|
68
|
+
"ndfa",
|
|
69
|
+
"turing"
|
|
70
|
+
],
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=18"
|
|
73
|
+
}
|
|
74
|
+
}
|