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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Evaluator not recognizing variable name. Error: The name cannot contain the '$' symbol.

luomein opened this issue · comments

Alloy 6.1.0, Mac OS 13.6.3

In the Evaluator, sometimes the variable name will raise error, The name cannot contain the '$' symbol.

{Node$0} ---> work fine
{Node$1} ---> work fine
{Node$0} + {Node$1} ---> work fine
{Node$0, Node$1} ---> error1
{(Node$0), (Node$1)} ---> error2
{List$0->Node$0, List$0->Node$1} ---> error2

error1:
The name cannot contain the '$' symbol.

error2:
Syntax error at line 1 column 10:
There are 38 possible tokens that can appear here:
! # ( * @ Int NAME NUMBER STRING String ^ after all always before disj eventually fun historically iden int let lone no none once one pred seq set some steps sum this univ { } ~

image

The '{' is not valid Alloy syntax. Message could be better but the curly braces are the problem. This works:

(Node$0+Node$1) & Node$1

For convenience, you can also use the Foo¹ that you can copy from the output.