algebra.fromStates
This function gives the states that a transition leaves. The state "*" is each state that is not final.
CLI- Package
- @procedures/algebra · README
- Path
["algebra","fromStates"]- CLI
mark algebra fromStates --m <object> --from <string | string[]>- As data
{"$proc":["algebra","fromStates"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/algebra/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["algebra","fromStates"], { m: {}, from: "<from>" });
console.log(JSON.stringify(result));From the command line
$ mark algebra fromStates --m <object> --from <string | string[]>
As data, in a program
{
"$proc": ["algebra", "fromStates"],
"input": { "m": {}, "from": "<from>" }
}Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
m | object | yes | ||
from | string | string[] | yes |
Output
The schema does not list fields (string[]).
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"m": {
"type": "object",
"properties": {
"states": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"properties": {
"initial": {
"type": "boolean"
},
"final": {
"type": "boolean"
},
"pseudo": {
"type": "boolean"
},
"note": {
"type": "string"
}
},
"additionalProperties": {}
}
}
},
"required": [
"states"
],
"additionalProperties": {}
},
"from": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"required": [
"m",
"from"
],
"additionalProperties": false
},
"output": {
"type": "array",
"items": {
"type": "string"
}
}
}