ModelInference / synoptic

Inferring models of systems from observations of their behavior
Other
81 stars 25 forks source link

Can not parse hello Bob example #422

Closed RubelAhmed57 closed 3 years ago

RubelAhmed57 commented 3 years ago

System: Linux userName-IdeaPad 5.4.0-48-generic #52~18.04.1-Ubuntu SMP Thu Sep 10 12:50:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Java version: openjdk version "1.8.0_265" OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~18.04-b01) OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)

input.log:

hello Bob
hello Alice

Command: ./synoptic.sh -r '^hello .+(?<TYPE=>hello)$' -o ./output/userName -d /usr/local/bin/dot input.log

Error: INFO: Using random seed: 1602838797427 INFO: Using the default partitions mapping regex: \k SEVERE: Regular expression: ^hello should contain either a TYPE named group or a STATE named group, but not both Exception in thread "main" synoptic.main.parser.ParseException: Regular expression: ^hello should contain either a TYPE named group or a STATE named group, but not both at synoptic.main.parser.TraceParser.addRegex(TraceParser.java:427) at synoptic.main.parser.TraceParser.(TraceParser.java:189) at synoptic.main.AbstractMain.parseIntoTraceGraph(AbstractMain.java:692) at synoptic.main.AbstractMain.createInitialPartitionGraph(AbstractMain.java:544) at synoptic.main.SynopticMain.main(SynopticMain.java:47)

bestchai commented 3 years ago

Have you tried one of the examples in the repo, e.g., StackAr: https://github.com/ModelInference/synoptic/tree/master/traces/StackAr/CallAndReturnStatesEqual

RubelAhmed57 commented 3 years ago

The example in the repository worked.

But my interest would be best served if I could parse src dest msg type traces, like in the documentation as follows:

node1 node2 hello Bob
node1 node3 goodbye Alice
node3 node1 re:hello
node2 node1 re:goodbye

The given regex ^(?<src>\w+) (?<dst>\w+) .+(?<TYPE=>\\k<src>->\\k<dst>)$ seems not working.

Any hints will be highly appreciated.