replace - Prolog - Term replacement, Term alteration in workflow graphs -
replace - Prolog - Term replacement, Term alteration in workflow graphs -
in link ( meta interpreter ) believe have found nifty way of solving problem have tackle, since prolog bad i'd first inquire if possible have in mind.
i want transform parts of workflow/graph depending on set of rules. graph consists of sequences (a->b) , split/joins, either parallel or conditional, i.e. 2 steps run in parallel in workflow or single branch picked depending on status (the status not matter on level) (parallel-split - (a && b) - parallel-join) etc. graph has nodes , edges, form of using terms want rid of edges.
furthermore each node has partner attribute, specifying execute it.
i'll seek give simple illustration want achieve:
a node called a, executed partner x, connected node called b, executed partner y.
a_x -> b_y seq((a,x),(b,y))
if observe pattern this, i.e. 2 steps in sequence different partners, want replaced with:
a_x -> send_(x-y) -> receive_(y-x) - b_y // send step x y , receive step @ y waiting x seq((a,x), seq(send(x-y), seq(receive(y-x), b)))
if give me pointers or help come solution thankful!
a graph consists of sequences (a->b) , split/joins, either parallel or conditional, i.e. 2 steps run in parallel in workflow or single branch picked depending on condition
this sounds awful lot and/or graph. prolog algorithms on these graphs covered ivan bratko in prolog programming artificial intelligence, chapter 13. if graphs aren't and/or graphs, may able adapt of these algorithms task.
replace prolog
Comments
Post a Comment