{"author":{"name":"Dominic Tarr","email":"dominic.tarr@gmail.com","url":"http://bit.ly/dominictarr"},"name":"fsm","description":"Finite State Machine - Separate Control Flow from IO","version":"0.0.0","homepage":"https://github.com/dominictarr/fsm","repository":{"type":"git","url":"git://github.com/dominictarr/fsm.git"},"main":"fsm.js","scripts":{"test":"meta-test test/*.js"},"engines":{"node":">= 0.2.0"},"dependencies":{},"devDependencies":{"it-is":"0.0"},"_id":"fsm@0.0.0","_engineSupported":true,"_npmVersion":"1.0.8","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"85764a52545c1b1a091082c5ca41c954b4034860","tarball":"http://registry-npm.ywwl.com/fsm/download/fsm-0.0.0.tgz","integrity":"sha512-IY7Vvu07SB+HDsHBCYqzb67MV7SE9wIEMgB2I8wMr0xokGB/kpwrFiVmbkU6nMRTd8X3Xhlb7cykcs7u1fCHHQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQDVr8WU5bIteDIq4AbZ5ZTNKvCxnotgd1AlWBokgouAiEA/5CwIRfj9zlyfIphB0IvaVYQReHKC98UHTRMLs1tH14="}],"size":1520,"noattachment":false,"key":"/fsm/-/fsm-0.0.0.tgz"},"directories":{},"readme":"# fsm\n\ncheck properties of finite state machines.\n\nThere is a lot of academic research in this area, yet this module is very simple.\nThere are a lot of fancy tools available, but they are not easy to use.\nIf idea is really useful, then I think a very simple tool should be viable.\n\n## License\n\nMIT\n\n# Example\n\nDefine FSM as json, here is a stream with 4 states.\nThis FSM expresses the constraint that the stream *must not*\nemit 'data' when paused, and also that it *must not* emit\ndata after 'end'.\n\n``` js\n{\n  START: {\n    data   : 'START',\n    pause  : 'PAUSED',\n    end    : 'END',\n    error  : 'ERROR'\n  },\n  PAUSED: {\n    pause  : 'PAUSED',\n    resume : 'START',\n    error  : 'ERROR'\n  },\n  ERROR: {},\n  END: {}\n}\n```\n\nwe can check a number of properties of this machine.\ndoes this machine halt? (and in the right place?)\ncan you reach every state from every other?\n\n## API\n\n### validate (fsm)\n\ncheck that all transitions are to defined states.\n\n### reachable (fsm)\n\ncalculate all states can reach each other states.\nthe result is in the form of\n\n``` js\n{STATE1: {STATE2: [event path from S1 to S2]}}\n```\n\n### terminal (fsm)\n\nreturn the list of states that cannot reach another state.\n\nalias: `deadlock'\n\n### livelock (fsm, [terminal])\n\nget list of states that cannot reach a terminal state.\n\n### combine(fsm1, fsm2, start1, start2)\n\ncombine two fsm into one, obeying all the transitions in each.\nTODO: throw an error if there are transitions that are impossible in the combined machine.\n\n\n","publish_time":1307938275862,"maintainers":[{"email":"nopersonsmodules@gmail.com","name":"nopersonsmodules"}],"_cnpm_publish_time":1307938275862,"dist-tags":{"latest":"1.0.2"}}