I have to run two sets of rules sequencely. Firstly, I run a set of rules, and get some results from the reasoning. Secondly, I want to run another set of rules based on the results from the first step. Can anyone tell me how to do so in JENA?
Thank you!
Yang
Related
I'm using Z3 with the ml interface. I had created a formula
f(x_i)
that is satisfiable, according to the solver
Solver.mk_simple_solver ctxr.
The problem is: I can get a model, but he find me values only for some variables of the formula, and not all (some of my Model.get_const_interp_er end with a type None)
How can it be possible that the model can give me only a part of the x_ir? In my understanding, if the model work for one of the values, it means that the formula was satisfiable (in my case, it is) and so all the values can be given...
I don't understand something..
Thanks for reading me!
You should always post full examples so people can help with actual coding issues; without seeing your actual code, it's impossible to know what might be the actual reason.
Having said that, this sounds very much like the following question: Why Z3Py does not provide all possible solutions So, perhaps the answer given there will help you.
Long story short: Z3 models will only contain values for variables that matter for the model. For anything that is not explicitly assigned, any value will do. There are ways to get "full" models as explained in that answer of course; which I'm sure is also possible from the ML interface.
I am currently dealing with a situation where the assertions given to Z3 contain a large number of inequalities and equalities. They are dependent on each other in a way that it is most efficient to start solving the formula by assigning values to the variables used in the equalities.
Is there a way to alter the heuristics of Z3 such that the solver always chooses to "start" at these formulas?
My guess would be to use a tactic which initially processes a goal containing the mentioned equalities. It would then continue with the other assertions, restarting the whole process if necessary.
However, I'm not sure how to go about implementing this - how can I create custom goals from sets of formulas?
You can try asserting the first set of formulas you want, then issue check-sat, issue the next set, issue check-sat; repeat as necessary. You can also use push-pop to go back to these points if you want.
By issuing multiple check-sats this way, you would be forcing the solver to explore the formulas you asserted up to that point. Whether this would actually achieve what you want of course depends on exactly what your formulas look like and how much the solver can derive at each check-sat call.
I am trying to do general linear model analysis using SPSS syntax coding. I wrote a syntax to split my file and then apply GLM. This code used to work perfectly for my other variables in the same dataset but today when I look at the output file I can see that the code is ignoring the split command. Even the previous ones are not working anymore. Could you please help me with this? The syntax is below. SW_CODE is the variable (0- 1) that I like to split. Am I missing something?
sort cases by SW_CODE.
split file by SW_CODE.
GLM ATTITUDE_2 BY SW_CODE COND_CODE newfactor
/METHOD = SSTYPE(3)
/INTERCEPT = INCLUDE
/PRINT = DESCRIPTIVE
/CRITERIA = ALPHA(.05)
/EMMEANS=TABLES(newfactor*COND_CODE) compare (newfactor) /DESIGN.
split file off.
IF you can help me fix this I'd appreciate it.
Thanks in advance.
Remove SW_CODE variable from the GLM syntax and it should work as intended.
sort cases by SW_CODE.
split file by SW_CODE.
GLM ATTITUDE_2 BY SW_CODE COND_CODE newfactor
The way you wrote it makes it impossible for SPSS to test an effect of SW_CODE while spliting database by level of same variable
In Cucumber, I had something like this
#do_this
#de #fr #it #us
Scenario: Do something irrelevant
Given ...
When ...
Then
#do_that
#de #fr #it #us
Scenario: Do a different irrelevant thing
Given ...
When ...
Then
It was possible to do something like cucumber -t #de -t #do_this, so only scenarios which matched both tags would be run. I can't seem to get the same behavior in Rspec, though. In the above example, only the first scenario would run, even though the second one also has a #de tag.
Background: I have a platform which is rolled out in many countries, and not all features are available in every country. So the nice thing was that I could just tag the scenarios accordingly, and then call individual scenarios from the command line. I am currently in the process of switching to Rspec from Cucumber because of several reasons, but this is the only thing holding me back at the moment. Of course I am also open for other suggestions on how to approach this.
Short version: I would like to call individual tests in Rspec who match two or more tags.
RSpec tag expressions are only ORed for inclusion and ANDed for exclusion, so you can't do what you want in general. Further, it appears that you can use either tag filters or a filter on the example descriptions, but not both, so I think that combining those two techniques is out as well. (Perhaps someone can correct me on this).
However, if you have a limited/structured situation implied by your example, I think you can do the following:
Define a boolean tag for each of the languages and use the traditional inclusion filter
Define a do tag with values of this, that, etc. and use a lambda exclusion filter which will exclude everything but the value(s) you want.
If you do the above, you will be able so specify examples which contain any of the languages you want and whatever subset of the do values you want
However, I doubt there is a way to specify the lambda expression format in the command line so I think you're limited to using the configuration option approach. In any event, see http://rubydoc.info/github/rspec/rspec-core/RSpec/Core/Configuration:filter_run_excluding for a description of the underlying capability.
That's a lot of limitations, I know. This seems like an area where RSpec could be fairly easily extended, so perhaps we'll see extensions in the future.
I have access to a grammar, and want to use it to generate code samples that follow the grammar.
Is there some existing tool that does this? If not, what is the right approach?
You could try mutt or some of the tools listed here might do what you are looking for.
If you wanted to implement a text generator yourself, you could randomly select a possible expansion of the current symbol and go down the path until you cannot any more or reached a limit, then try to select a terminator symbol if available