Re: [prism] loadPRISMModel returns NullPointerException

6 views
Skip to first unread message

Dave Parker

unread,
Aug 9, 2015, 6:43:29 PM8/9/15
to prismmod...@googlegroups.com, random.e...@gmail.com
Hi John,

You need a call to prism.initialise() after you create the prism object.

Look at the code in src/prism/PrismTest.java to see a working example.

Best wishes,

Dave.

On 08/08/2015 17:29, John Smith wrote:
> Hi All,
>
> I am running PRISM programmatically but when I try to load the PRISM
> model it returns the following error:
>
> Exception in thread "main" java.lang.NullPointerException
> at prism.Prism.loadPRISMModel(Prism.java:1630)
>
> I have already tested the model file using the PRISM GUI and it works,
> and as far as I can tell parseModelFile is loading the file correctly.
>
> My code is this:
>
> |
> try{
> Prismprism
> =newPrism(|newPrismFileLog("stdout")|,newPrismFileLog("stdout"));
> prism.setEngine(Prism.HYBRID);
> ModulesFilemf =prism.parseModelFile(newFile(model_path));
> PropertiesFilepf
> =prism.parsePropertiesFile(mf,newFile(props_path));
> prism.loadPRISMModel(mf);
> prism.modelCheck(pf,pf.getProperty(0));
> }catch(PrismExceptione){
> System.out.println(e);
> }catch(FileNotFoundExceptione){
> System.out.println(e);
> }
> |
>
> Any help or advice would be greatly appreciated.
>
> Many thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "PRISM model checker" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to prismmodelchec...@googlegroups.com
> <mailto:prismmodelchec...@googlegroups.com>.
> To post to this group, send email to prismmod...@googlegroups.com
> <mailto:prismmod...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/prismmodelchecker.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages