How to implement the following Alloy model in Alloy API? -


i have following alloy model , i'm not sure how cenvert alloy java api.

sig a{ b: int }

i know can use a.addfield("b", expr) add atribute, should put in expr parameter make represents integers?

thanks

it easier parse entire alloy model string instead of creating ast manually. see post example. example uses

computil.parseeverything_fromfile(..., <file_name>) 

but can replace

computil.parseonemodule_fromstring("sig a{ b: int}") 

to parse directly string (note return type in latter case list<command>, , not compmodule in linked example, shouldn't problem you).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -