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
Post a Comment