I am wondering if it is possible to generate a model specification for a given instance. My goal is to check whether an instance conforms to a model or not.
I have found a paper dealing with automatic specification of instances. It is called 'An Automated Approach for Writing Alloy Specifications Using Instances' (http://users.ece.utexas.edu/~khurshid/papers/2006/06isola-aDeryaft.pdf). If I am not mistaken, this could be a way to check whether an instance conforms to a model. Unfortunately there seems to be no implementation available for download.
Do you know how I could check whether a given instance conforms to a model or not?
Thanks for your time.
To check whether or not an instance conforms to a given model, you can programmatically check (using the Alloy api) that all atoms and tuples of the instance are typed by signatures and fields of the model, and that all facts declared in the model hold in the instance.
The paper you refered to describe an approach to generate a new Alloy model from given instances. Though interesting it has little to do with what you are trying to achieve, i.e., check if a given instance conforms to an already existing model.