0

I want to parse an mci file format for storing petri net unfolding prefixes in java so that I can use it to generate SAT formula

the below text describes the MCI file format for storing Petri net unfolding prefixes.

Below, CHAR is a 1-byte char, and UINT4 is a little-endian (i.e. the least significant byte is at the lowest address, and the other bytes follow in increasing order of significance.) 4-byte unsigned int (Intel is little-endian).

  • the total number of conditions (UINT4)

  • the total number of events (UINT4)

  • for each event (from first to last): -- the number of the original transition (UINT4)

  • for each condition (from first to last): -- the number of the original place (UINT4) -- the number of the preset event (UINT4); it's 0 if the condition is initial -- NULL(UINT4)-terminated list of postset events numbers (UINT4)

  • for each cut-off event -- the number of cut-off event (UINT4) -- the number of corresponding event (UINT4) or NULL(UINT4) if the corresponding event is the virtual initial event

  • separating NULL(UINT4)

  • for each configuration: -- NULL(UINT4)-terminated list of events numbers. (This is used by some ancient model checker; PUNF doesn't create it and just outputs the terminating NULL(UINT4).)

  • separating NULL(UINT4)

  • the total number of places in the original net (UINT4)

  • the total number of transitions the in original net (UINT4)

  • the maximal string length for place/transition names (UINT4) (useful for memory allocation in the parser)

  • for each place in original net: -- the name (NULL(CHAR)-terminated string)

  • separating NULL(UINT4)

  • for each transition in original net: -- the name (NULL(CHAR)-terminated string)

  • terminating NULL(UINT4).

Note : I have got the implementation in C++ but I want it in java. For your info. I have used so many tools to convert it to java but none of them worked completely. So, I will appreciate any help from you guys.More, I ll put the code in C++ if needed.

1 Answer 1

0

I think you are looking for DataInputStream.

This should allow you to read your individual uint4 and characters.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.