FAMILIAR-project / familiar-language

FAMILIAR language and API
13 stars 3 forks source link

Impossible to create a configuration using SPLOT #16

Open surli opened 11 years ago

surli commented 11 years ago

After changing the _DEFAULT_VP_CF variable in ConfigurationVariableFactory, I get the following error when I try to make a configuration :

fml> toto = configuration a org.sat4j.minisat.SolverFactory.newMiniSAT()

error: Unable to create a configuration Problems loading model. Location might be wrong or model does not follow SXFM specification (error=java.lang.NullPointerException) null
FAMILIAR-project commented 11 years ago

Are you sure to use the last version ?

What is toto ?

surli commented 11 years ago

I just pull the last version, re-export (correctly this time ;)) the jar and execute the following command:

urli@localhost ~/familiar$ java -Xmx512m -jar FAMILIAR_1.0.7_SPLOT.jar --verbose DEBUG FMLShell:429 - Launching FAMILIAR DEBUG: Loading prompt. FAMILIAR (for FeAture Model scrIpt Language for manIpulation and Automatic Reasoning) version 1.0.7 (beta) http://familiar-project.github.com/ fml> a = FM(a: B C D E F;) DEBUG FMLShell:579 - FAMILIAR: a = FM(a: B C D E F;) DEBUG: (Info cmd) a = FM(a: B C D E F;) DEBUG FMLCommandInterpreter:303 - resourseSet creation... DEBUG FMLCommandInterpreter:305 - resourseSet=org.eclipse.xtext.resource.SynchronizedXtextResourceSet@618eabf6 resources=[] DEBUG FMLCommandInterpreter:319 - resourseSet options loaded + resource dummy... DEBUG FMLCommandInterpreter:321 - resource=org.eclipse.xtext.linking.lazy.LazyLinkingResource@6185e90f uri='dummy:/example901865304.fml' DEBUG AbstractInternalAntlrParser:562 - Parsing took: 80 ms DEBUG AbstractCleaningLinker:35 - beforeModelLinked took: 2ms DEBUG AbstractCleaningLinker:41 - doLinkModel took: 31ms DEBUG AbstractCleaningLinker:47 - afterModelLinked took: 0ms DEBUG FMLCommandInterpreter:335 - resourse loaded... DEBUG OnChangeEvictingCache:273 - Clear 10 cache entries for resource example901865304.fml after 0 hits and 10 misses (quota: 0%) DEBUG FMLCommandInterpreter:358 - model: org.xtext.example.mydsl.fML.impl.FamiliarScriptImpl@6adff0ea (eProxyURI: dummy:/example901865304.fml#/) DEBUG FMLCommandInterpreter:374 - parsing: org.xtext.example.mydsl.fML.impl.ScriptCommandImpl@1441c977 (eProxyURI: dummy:/example901865304.fml#//@cmds.0) DEBUG FMLCommandInterpreter:1011 - parsing: complex command org.xtext.example.mydsl.fML.impl.ComplexCommandImpl@6b11ae04 (eProxyURI: dummy:/example901865304.fml#//@cmds.0/@cmd) with var=a DEBUG FMLCommandInterpreter:1428 - No longer possible to declare parameters DEBUG FMLCommandInterpreter:1440 - Number of arguments (0) or parammeters (0) is correct. DEBUG FMLCommandInterpreter:890 - assignment: a = 2123536766 DEBUG FMLCommandInterpreter:1802 - variable a does not exist: fr.unice.polytech.modalis.familiar.interpreter.VariableNotExistingException: variable a does not exist DEBUG FMLCommandInterpreter:1812 - Creation needed DEBUG FMLShell:680 - (DISPLAYING) a: (FEATURE_MODEL) a: D B E C F ;

a: (FEATURE_MODEL) a: D B E C F ; fml> toto = configuration a DEBUG FMLShell:579 - FAMILIAR: toto = configuration a DEBUG: (Info cmd) toto = configuration a DEBUG FMLCommandInterpreter:319 - resourseSet options loaded + resource dummy... DEBUG FMLCommandInterpreter:321 - resource=org.eclipse.xtext.linking.lazy.LazyLinkingResource@40944dbd uri='dummy:/example740478218.fml' DEBUG AbstractInternalAntlrParser:562 - Parsing took: 5 ms DEBUG AbstractCleaningLinker:35 - beforeModelLinked took: 0ms DEBUG AbstractCleaningLinker:41 - doLinkModel took: 0ms DEBUG AbstractCleaningLinker:47 - afterModelLinked took: 0ms DEBUG FMLCommandInterpreter:335 - resourse loaded... DEBUG OnChangeEvictingCache:273 - Clear 5 cache entries for resource example740478218.fml after 0 hits and 5 misses (quota: 0%) DEBUG FMLCommandInterpreter:358 - model: org.xtext.example.mydsl.fML.impl.FamiliarScriptImpl@35fb2ef9 (eProxyURI: dummy:/example740478218.fml#/) DEBUG FMLCommandInterpreter:374 - parsing: org.xtext.example.mydsl.fML.impl.ScriptCommandImpl@7dc8f91e (eProxyURI: dummy:/example740478218.fml#//@cmds.0) DEBUG FMLCommandInterpreter:1011 - parsing: complex command org.xtext.example.mydsl.fML.impl.ComplexCommandImpl@155b6116 (eProxyURI: dummy:/example740478218.fml#//@cmds.0/@cmd) with var=toto DEBUG FMLCommandInterpreter:1980 - parsing confCmd=org.xtext.example.mydsl.fML.impl.CreateConfigurationImpl@2242f64e (eProxyURI: dummy:/example740478218.fml#//@cmds.0/@cmd/@left) DEBUG FMLCommandInterpreter:470 - identifier: DEBUG MySATConfigurationEngine:45 - Now loading the solver... org.sat4j.minisat.SolverFactory.newMiniSAT() DEBUG FMLShell:680 - (DISPLAYING) ########### error: Unable to create a configuration Problems loading model. Location might be wrong or model does not follow SXFM specification (error=java.lang.NullPointerException) null

########### error: Unable to create a configuration Problems loading model. Location might be wrong or model does not follow SXFM specification (error=java.lang.NullPointerException) null DEBUG FMLCommandInterpreter:890 - assignment: toto = 593348385 DEBUG FMLCommandInterpreter:1802 - variable toto does not exist: fr.unice.polytech.modalis.familiar.interpreter.VariableNotExistingException: variable toto does not exist DEBUG FMLCommandInterpreter:1812 - Creation needed DEBUG FMLShell:680 - (DISPLAYING) toto: (CONFIGURATION) selected: [] deselected: []

toto: (CONFIGURATION) selected: [] deselected: []

FAMILIAR-project commented 11 years ago

Try to execute FML.java (package standalone)

FAMILIAR (for FeAture Model scrIpt Language for manIpulation and Automatic Reasoning) version 1.0.7 (beta) http://familiar-project.github.com/ fml> a = FM(a: B C D E F;) a: (FEATURE_MODEL) a: D B E C F ; fml> foo = configuration a foo: (CONFIGURATION) selected: [D, E, F, B, C, a] deselected: [] fml>

surli commented 11 years ago

That works as long as I don't try to use SPLOT representation of configuration.

FAMILIAR-project commented 11 years ago

Yes you're right ;-)

The reason is not so obvious:

And of course the two versions are not compatible. The current solution is to "prioritirize" a version... It can be done by tuning the MANIFEST.MF

An expected improvement is to define a class loader that will select at runtime the "right" version of SAT4J.

@barais Can you point out how to use kevoree class loader ?

surli commented 10 years ago

Is this question of using the right version of SAT4J at runtime solved? As merge operator uses SAT4J do I need a specific version of sat4j for that?

Then I only use BDDConfigurations (I set up propery the DEFAULTVP_CF variable in ConfigurationVariableFactory) which version of SAT4J do I need to use ?

Currently I have both SAT4J 2.0.0 (in lib directory) and SAT4J 2.3.5 (by MANIFEST.MF), is it ok?