简体   繁体   中英

Alloy model without GUI

I want to write a scalable program in Python that would create Alloy models depending on the user input. In particular, I want user to input a graph and use Alloy to tell the user whether the graph has an Eulerian path. I have the model ready in Alloy for a particular instance of graph. However, I am thinking of generating .als file via Python code and then fire up Alloy through Python to evaluate the model. Is there an Alloy API I can use or any command line arguments that can help me decide whether a certain predicate is consistent or not ?

Thanks

A colleague of mine asked me the same question few days ago.

I developed a small Java program based on the Alloy API that takes a path to a given Alloy module as input, analyses the input module (taking into consideration the first command encountered), and display (as output) if the analyzer found a satisfiable instance for the given module and command.

Here is a link to this very simple program. https://www.dropbox.com/s/9ekwegj0ltfs8lq/alloy_text-based.jar?dl=0

Hope it helps

There is no Alloy API for Python. The official API is in Java ; examples of the API usage can be found here (as well as here on StackOverflow). There is also an embedding of Alloy in Ruby , which is still in alpha.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM