AlloyTools / org.alloytools.alloy

Alloy is a language for describing structures and a tool for exploring them. It has been used in a wide range of applications from finding holes in security mechanisms to designing telephone switching networks. This repository contains the code for the tool.
Other
709 stars 124 forks source link

Couldn't open modules which is an alloy module file as markdown style #55

Closed cutsea110 closed 6 years ago

cutsea110 commented 6 years ago

I installed Alloy-5.0.0.1 on windows 10 system. And I try the new feature - markdown syntax.

My tring code are:

---
title: Foo
layout: default
---

```alloy
sig Foo{
}
```

and

---
title: Bar
layout: default
---

```alloy
open Foo
```

I succeed to execute Foo.md on my alloy analyzer. But I got error at executing Bar.md and alloy analyzer highlighted my code 'open Foo' line.


Starting the solver...

A syntax error has occured:
This module cannot be found.
It is not a built-in library module, and it cannot be found
at
"C:\Users\cut-sea\project\alloy\study-for-curriculum-by-alloy\Foo.als".

Could i import my Foo.md as markdown style ?

pkriens commented 6 years ago

Did you call it C:\Users\cut-sea\project\alloy\study-for-curriculum-by-alloy\Foo.als ?

cutsea110 commented 6 years ago

No, My project files are Foo.md and Bar.md. I've NOT Foo.als.

pkriens commented 6 years ago

Alloy is looking for Foo.als ...

I guess for Alloy this is ok since Alloy does not care what the extension is when it edits a file. I.e. the markdown is supported also when it is called .als. However, this won't work on Github ...

I guess we could also look for an '.md' file but that will require an ok from the others on the team. @aleksandarmilicevic @eskang ?

cutsea110 commented 6 years ago

I’m developping models,preds and asserts on alloy analyser now. I’d like to make my alloy codes a specification like as Dining Philosophers, and to share it with my team members.

Do you have any good ideas?

pkriens commented 6 years ago

I've committed a branch that also checks for '.md' files when it cannot find a '.als' file.

This needs to be approved by one of the other committers. Once that is done, it will be available from https://oss.sonatype.org/content/repositories/snapshots/org/alloytools/org.alloytools.alloy.dist/5.0.0-SNAPSHOT/ (pick the latest date then.) We probably do another release in the next few weeks. If you're really stressed, send me a mail and I send you a jar file.

cutsea110 commented 6 years ago

Thank you! I'll try SNAPSHOT and wait the release.

pkriens commented 6 years ago

It is currently in the snapshot repository.

cutsea110 commented 6 years ago

HI, pkriens.

I've tried SNAPSHOT. But I got the same error.

Please reconfirm this patch. I guess the path "Util.jarPrefix() + "models/" is wrong, isn't it? I'd like to execute .md under my project directory.