harshal.c
harshal.c

Reputation: 306

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

Upvotes: 3

Views: 667

Answers (2)

Loïc Gammaitoni
Loïc Gammaitoni

Reputation: 4171

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

Upvotes: 2

Aleksandar Milicevic
Aleksandar Milicevic

Reputation: 3867

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.

Upvotes: 0

Related Questions