You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
(3) |
Aug
(2) |
Sep
(6) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
2009 |
Jan
(1) |
Feb
(9) |
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(2) |
From: Barry B. <bar...@st...> - 2008-09-07 13:29:23
|
> 1) Interesting, but understandable. (It is possible, of course, but > would require checking, if the Builtin can handle the particular situation.) Yes, so the blanket requirement is only one unbound term. If we went down the road of trying to be as flexible as possible we would end up with a large number of special cases, e.g. DIVIDE(?X, ?X, 1) => any numeric value for ?X, except zero MULTIPLY(?X, ?X, 0) => ?X=0 (single value) MULTIPLY(?X, ?X, 1) => ?X=1 or ?X=-1 (two values) MULTIPLY(?X, 1, ?X) => ?X=any values (infinite values) > 2) I understand your concern towards query-independence (I think). Also, > I understand where the implementation is restricted in respect to query > evaluation (predicates are gone, only precomputed facts remain), which > really is a consequence of the former. I think, where I do not follow is > that the following two queries deliver different results. > > ?- EQUAL(5,?x). > > eq(?x,?y) :- EQUAL(?x,?y). > ?- eq(5,?x). > > Note that I do understand /why/ that is, I only don't think those > programs /ought/ to behave differently. But then again, I am no expert > in logic programming, and my guts may be simply wrong. :) Actually, your guts are quite correct! IRIS uses only bottom-up evaluation (at the moment - SLDNF is on the way), so we have a big computational cost to evaluate the model. Strictly speaking, we should recalculate this model based on the query as the ground terms here are part of the universe. We *should* recompute the model for every query? So far, only you have noticed this! > Thanks again for that piece of insight. Time for some more code diving. :] No problem. It seems we are both don't have anything better to do on a sunday! barry |
From: Murat K. <mur...@st...> - 2008-09-07 12:52:52
|
Hi Barry, thanks for your answer, it did not only made parts of the implementation clearer, but more importantly also your intention behind them. Since I don't want to steal too much of your time, I'll try to be brief, too. 1) Interesting, but understandable. (It is possible, of course, but would require checking, if the Builtin can handle the particular situation.) 2) I understand your concern towards query-independence (I think). Also, I understand where the implementation is restricted in respect to query evaluation (predicates are gone, only precomputed facts remain), which really is a consequence of the former. I think, where I do not follow is that the following two queries deliver different results. ?- EQUAL(5,?x). eq(?x,?y) :- EQUAL(?x,?y). ?- eq(5,?x). Note that I do understand /why/ that is, I only don't think those programs /ought/ to behave differently. But then again, I am no expert in logic programming, and my guts may be simply wrong. :) Thanks again for that piece of insight. Time for some more code diving. :] Greetings, Murat B.Sc. Hasso-Plattner-Institute www.hpi-web.de Barry Bishop wrote: > Hi Murat, > > Thanks for your interest in IRIS and thanks for spotting a bug for us! > > 1) Safe rules in IRIS > > By default (using the default constructor of > StandardRuleSafetyProcessor), IRIS allows an arithmetic built-in to > compute up to one missing term, e.g. > > q(?Y) :- p(?X), ADD(?X, ?Y, 5) (X is bound, Y can be calculated) > > (Strictly speaking, this should not be allowed, because a safe rule in > Datalog is one where *all* head variables appear in positive ordinary > predicates.) > > However, only one term (not one variable) can be computed, e.g. > > q(?Y) :- p(?Z), ADD(?X, ?X, ?Z) > > is not allowed, because two terms of ADD() are unbound. The fact that > both terms are the same variable is not considered. In the case of > addition, a value for X can be determined, but this is not true > generally for arithmetic built-ins, e.g. SUBTRACT( ?X, ?X, 0 ) would > allow any value for ?X, hence rules containing built-in arithmetic > predicates with more than 1 unbound *term* are considered unsafe rules. > > > > 2) Unsafe rules in IRIS > > As you probably know from the source code, IRIS uses a simple trick to > turn unsafe rules in to safe rules. It simply adds UNIVERSE(?var) > literals to rule bodies for every unbound variable and then does it's > best to make sure that every ground term in the program is added to the > relation for this (Herbrand) universe predicate, e.g. > > q(?X, ?Y) :- ADD(?X, ?Y, 5) > > is unsafe and IRIS adds two literals to turn it in to this safe rule: > > q(?X, ?Y) :- ADD(?X, ?Y, 5), UNIVERSE(?X), UNIVERSE(?Y) > > Notice, that technically speaking, this rule only needs to add a single > universe term, either for ?X or for ?Y to make it safe. However, this > choice can alter the behaviour of the program and eventual query result > so the decision was made to try avoid any ambiguity. Therefore, when a > rule is unsafe, all the unbound variables from a built-in will get their > own universe predicate. > > Also, ground terms in queries are not considered part of the universe of > terms. The simple reason being, that the model of the program should not > be affected by the query being asked. Again, this is an assumption that > is not clearly documented, but for IRIS, the knowledge base is first > initiliased and queries are later executed against it. (I'm willing to > be persuaded as to whether this is semantically correct!) > > > 3) Your examples > > Ex2. some_calc(?X,?Z) :- MULTIPLY(?X,?X,?Y), ADD(?Y,-1, ?Z). > > becomes: > some_calc(?X, ?Z) :- MULTIPLY(?X, ?X, ?Y), ADD(?Y, -1, ?Z), > $UNIVERSE$(?Y), $UNIVERSE$(?X), $UNIVERSE$(?Z) > > where $UNIVERSE$ contains only the single value '-1' and both built-ins > evaluate to false. > > > Ex3. eq_ordinary(?x, ?y) :- EQUAL(?x,?y). > > becomes: > eq_ordinary(?x, ?y) :- EQUAL(?x,?y), $UNIVERSE$(?X), $UNIVERSE$(?Y) > > and since there are no grounds terms in this program, the rule never fires. > > 4) The bug. > > Yes indeed, you have correctly identified a serious bug and I am > somewhat embarrassed that there is no unit test that catches this. I > will try to remedy this situation as soon as possible, but thanks very > much for pointing it out. > > For the sake of brevity I will stop now, but I hope this helps you to > understand some of the idiosyncrasies of IRIS. > > Kindest regards, > barry > > > Murat Knecht wrote: > >> Hi, >> >> I have a question regarding built-ins. Having taken a look at the source >> code, I would like to understand why the following datalog programs do >> not work as (I) expected. (They are appended below.) >> >> Program 1 works as expected, but 2 and 3, on the other hand, do not. >> With 2 I expected to get the correct answer to the calculation, i.e. 24. >> Program 3 was supposed to deliver 6, obviously. This ought to be >> possible through the IRIS feature of deducing the last number involved >> e.g. in a ternary mathematical predicate, but which also applies to the >> EQUAL-predicate. >> >> My explanation is that, after building the knowledge base, the facts are >> all that is left - the rules are not looked at again during query >> evaluation. This results in the might of the UNIVERSE variable, which >> ought to solve problems like program 3, to get lost . It also leads to >> the deduction capabilities of the EQUAL-predicate to not be applied to >> the constant in the query - producing an empty result set. >> >> Is my understanding of the matter correct? >> >> >> And I would like to know if the following is a bug or intended behavior. >> FiniteUniverseFact: The method >> >> void extractGroundTerms( Collection<IRule> rules ) >> >> twice extracts the ground terms from the rule's head but never from the >> body. I suppose this is a copy-and-paste error? >> http://iris-reasoner.svn.sourceforge.net/viewvc/iris-reasoner/iris/trunk/src/org/deri/iris/facts/FiniteUniverseFacts.java?view=markup&pathrev=1593 >> >> Thanks, >> Murat >> >> >> ==== 1. ==== >> pred1('p1' , 'p2'). >> pred2('p2' , 'p3'). >> pred(?X,?Z) :- pred1(?X,?Y), pred2(?Y,?Z). >> ?-pred('p1',?X). >> ---------------------------------- >> Query: ?- pred('p1', ?X). ==>> 1 row in 0ms >> Variables: ?X >> ('p3') >> >> >> ==== 2. ==== >> some_calc(?X,?Z) :- MULTIPLY(?X,?X,?Y), ADD(?Y,-1, ?Z). >> ?-some_calc(5,?Z). >> ---------------------------------- >> Query: ?- some_calc(5, ?Z). ==>> 0 rows in 0ms >> Variables: ?Z >> >> >> ==== 3. ==== >> eq_ordinary(?x, ?y) :- EQUAL(?x,?y). >> ?-eq_ordinary(6,?q). >> ---------------------------------- >> Query: ?- eq_ordinary(6, ?q). ==>> 0 rows in 0ms >> Variables: ?q >> >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge >> Build the coolest Linux based applications with Moblin SDK & win great prizes >> Grand prize is a trip for two to an Open Source event anywhere in the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> iris-reasoner-support mailing list >> iri...@li... >> https://lists.sourceforge.net/lists/listinfo/iris-reasoner-support >> > > |
From: Barry B. <bar...@st...> - 2008-09-07 11:56:10
|
Hi Murat, Thanks for your interest in IRIS and thanks for spotting a bug for us! 1) Safe rules in IRIS By default (using the default constructor of StandardRuleSafetyProcessor), IRIS allows an arithmetic built-in to compute up to one missing term, e.g. q(?Y) :- p(?X), ADD(?X, ?Y, 5) (X is bound, Y can be calculated) (Strictly speaking, this should not be allowed, because a safe rule in Datalog is one where *all* head variables appear in positive ordinary predicates.) However, only one term (not one variable) can be computed, e.g. q(?Y) :- p(?Z), ADD(?X, ?X, ?Z) is not allowed, because two terms of ADD() are unbound. The fact that both terms are the same variable is not considered. In the case of addition, a value for X can be determined, but this is not true generally for arithmetic built-ins, e.g. SUBTRACT( ?X, ?X, 0 ) would allow any value for ?X, hence rules containing built-in arithmetic predicates with more than 1 unbound *term* are considered unsafe rules. 2) Unsafe rules in IRIS As you probably know from the source code, IRIS uses a simple trick to turn unsafe rules in to safe rules. It simply adds UNIVERSE(?var) literals to rule bodies for every unbound variable and then does it's best to make sure that every ground term in the program is added to the relation for this (Herbrand) universe predicate, e.g. q(?X, ?Y) :- ADD(?X, ?Y, 5) is unsafe and IRIS adds two literals to turn it in to this safe rule: q(?X, ?Y) :- ADD(?X, ?Y, 5), UNIVERSE(?X), UNIVERSE(?Y) Notice, that technically speaking, this rule only needs to add a single universe term, either for ?X or for ?Y to make it safe. However, this choice can alter the behaviour of the program and eventual query result so the decision was made to try avoid any ambiguity. Therefore, when a rule is unsafe, all the unbound variables from a built-in will get their own universe predicate. Also, ground terms in queries are not considered part of the universe of terms. The simple reason being, that the model of the program should not be affected by the query being asked. Again, this is an assumption that is not clearly documented, but for IRIS, the knowledge base is first initiliased and queries are later executed against it. (I'm willing to be persuaded as to whether this is semantically correct!) 3) Your examples Ex2. some_calc(?X,?Z) :- MULTIPLY(?X,?X,?Y), ADD(?Y,-1, ?Z). becomes: some_calc(?X, ?Z) :- MULTIPLY(?X, ?X, ?Y), ADD(?Y, -1, ?Z), $UNIVERSE$(?Y), $UNIVERSE$(?X), $UNIVERSE$(?Z) where $UNIVERSE$ contains only the single value '-1' and both built-ins evaluate to false. Ex3. eq_ordinary(?x, ?y) :- EQUAL(?x,?y). becomes: eq_ordinary(?x, ?y) :- EQUAL(?x,?y), $UNIVERSE$(?X), $UNIVERSE$(?Y) and since there are no grounds terms in this program, the rule never fires. 4) The bug. Yes indeed, you have correctly identified a serious bug and I am somewhat embarrassed that there is no unit test that catches this. I will try to remedy this situation as soon as possible, but thanks very much for pointing it out. For the sake of brevity I will stop now, but I hope this helps you to understand some of the idiosyncrasies of IRIS. Kindest regards, barry Murat Knecht wrote: > Hi, > > I have a question regarding built-ins. Having taken a look at the source > code, I would like to understand why the following datalog programs do > not work as (I) expected. (They are appended below.) > > Program 1 works as expected, but 2 and 3, on the other hand, do not. > With 2 I expected to get the correct answer to the calculation, i.e. 24. > Program 3 was supposed to deliver 6, obviously. This ought to be > possible through the IRIS feature of deducing the last number involved > e.g. in a ternary mathematical predicate, but which also applies to the > EQUAL-predicate. > > My explanation is that, after building the knowledge base, the facts are > all that is left - the rules are not looked at again during query > evaluation. This results in the might of the UNIVERSE variable, which > ought to solve problems like program 3, to get lost . It also leads to > the deduction capabilities of the EQUAL-predicate to not be applied to > the constant in the query - producing an empty result set. > > Is my understanding of the matter correct? > > > And I would like to know if the following is a bug or intended behavior. > FiniteUniverseFact: The method > > void extractGroundTerms( Collection<IRule> rules ) > > twice extracts the ground terms from the rule's head but never from the > body. I suppose this is a copy-and-paste error? > http://iris-reasoner.svn.sourceforge.net/viewvc/iris-reasoner/iris/trunk/src/org/deri/iris/facts/FiniteUniverseFacts.java?view=markup&pathrev=1593 > > Thanks, > Murat > > > ==== 1. ==== > pred1('p1' , 'p2'). > pred2('p2' , 'p3'). > pred(?X,?Z) :- pred1(?X,?Y), pred2(?Y,?Z). > ?-pred('p1',?X). > ---------------------------------- > Query: ?- pred('p1', ?X). ==>> 1 row in 0ms > Variables: ?X > ('p3') > > > ==== 2. ==== > some_calc(?X,?Z) :- MULTIPLY(?X,?X,?Y), ADD(?Y,-1, ?Z). > ?-some_calc(5,?Z). > ---------------------------------- > Query: ?- some_calc(5, ?Z). ==>> 0 rows in 0ms > Variables: ?Z > > > ==== 3. ==== > eq_ordinary(?x, ?y) :- EQUAL(?x,?y). > ?-eq_ordinary(6,?q). > ---------------------------------- > Query: ?- eq_ordinary(6, ?q). ==>> 0 rows in 0ms > Variables: ?q > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > iris-reasoner-support mailing list > iri...@li... > https://lists.sourceforge.net/lists/listinfo/iris-reasoner-support -- Barry Bishop Senior Scientific Programmer Semantic Technology Institute (STI) University of Innsbruck, Austria ----------------------------------- E-Mail: bar...@st... Tel: +43 512 507 96873 ----------------------------------- |
From: Murat K. <mur...@st...> - 2008-09-06 20:45:33
|
Hi, I have a question regarding built-ins. Having taken a look at the source code, I would like to understand why the following datalog programs do not work as (I) expected. (They are appended below.) Program 1 works as expected, but 2 and 3, on the other hand, do not. With 2 I expected to get the correct answer to the calculation, i.e. 24. Program 3 was supposed to deliver 6, obviously. This ought to be possible through the IRIS feature of deducing the last number involved e.g. in a ternary mathematical predicate, but which also applies to the EQUAL-predicate. My explanation is that, after building the knowledge base, the facts are all that is left - the rules are not looked at again during query evaluation. This results in the might of the UNIVERSE variable, which ought to solve problems like program 3, to get lost . It also leads to the deduction capabilities of the EQUAL-predicate to not be applied to the constant in the query - producing an empty result set. Is my understanding of the matter correct? And I would like to know if the following is a bug or intended behavior. FiniteUniverseFact: The method void extractGroundTerms( Collection<IRule> rules ) twice extracts the ground terms from the rule's head but never from the body. I suppose this is a copy-and-paste error? http://iris-reasoner.svn.sourceforge.net/viewvc/iris-reasoner/iris/trunk/src/org/deri/iris/facts/FiniteUniverseFacts.java?view=markup&pathrev=1593 Thanks, Murat ==== 1. ==== pred1('p1' , 'p2'). pred2('p2' , 'p3'). pred(?X,?Z) :- pred1(?X,?Y), pred2(?Y,?Z). ?-pred('p1',?X). ---------------------------------- Query: ?- pred('p1', ?X). ==>> 1 row in 0ms Variables: ?X ('p3') ==== 2. ==== some_calc(?X,?Z) :- MULTIPLY(?X,?X,?Y), ADD(?Y,-1, ?Z). ?-some_calc(5,?Z). ---------------------------------- Query: ?- some_calc(5, ?Z). ==>> 0 rows in 0ms Variables: ?Z ==== 3. ==== eq_ordinary(?x, ?y) :- EQUAL(?x,?y). ?-eq_ordinary(6,?q). ---------------------------------- Query: ?- eq_ordinary(6, ?q). ==>> 0 rows in 0ms Variables: ?q |
From: Barry B. <bar...@st...> - 2008-08-11 06:26:24
|
Hi Murat, The IRIS reasoner uses bottom-up evaluation strategies, loosely base on those found in, Principles of Database Systems, Ullman 1983. It also uses the magic sets optimisation and will soon have a new top-down strategy based on SLD resolution. So for the time being, the 0.5.7 tag should be fine for your purposes. See the attached paper describing the reasoner for more information. Thanks for your interest in IRIS. Regards, Barry Bishop Senior Scientific Programmer Semantic Technology Institute (STI) University of Innsbruck, Austria ----------------------------------- E-Mail: bar...@st... Tel: +43 512 507 96873 ----------------------------------- Murat Knecht wrote: > Hi all, > > I intend to have a look at IRIS internals to gather some understanding > on how a reasoner works (or on how this one does, anyway). > Which version would you recommend, the 0.5.7 tag or the trunk and why? > > Thanks! > > Murat > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > iris-reasoner-support mailing list > iri...@li... > https://lists.sourceforge.net/lists/listinfo/iris-reasoner-support |
From: Murat K. <mur...@st...> - 2008-08-10 20:49:28
|
Hi all, I intend to have a look at IRIS internals to gather some understanding on how a reasoner works (or on how this one does, anyway). Which version would you recommend, the 0.5.7 tag or the trunk and why? Thanks! Murat |
From: Florian F. <flo...@st...> - 2008-07-30 13:51:09
|
Hi, what I mean is that after removing the axiom your example works just fine. The rest of your code also seems fine. I am pretty sure that this axiom: >> " axiom _# >> definedBy >> ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" >> hasValue ?cit] memberOf _"http://www.semantic-gov.org/Italy#Person" >> and ?cit = _"http://www.semantic-gov.org/Italy#belgianCitizenship"." is causing the problems (the unification). See http://www.wsmo.org/TR/d16/d16.1/v1.0/ definition 6.4, WSML-Rule logical expression. 1.) A head formula must not contain the unification operator (=). 2.) A formula alpha :- beta is a legal formula if alpha is in head and beta in body. 2.) The logic programming implication is not needed. If it is missing the formula is in head. Your axiom definition does not contain an implication but it contains the unification operator. So something in the axiom seems to be wrong. If this is carried over from a precondition of a capability then there might also be something wrong with the precondition. This is because the axiomdefinition, and more precisely the logical expression that is part of it (after the definedBy) that is part of the precondition has to obey the same rules and restrictions as any other axiom. If the axiom is really what you have in mind I would try rewritting it: ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" hasValue _"http://www.semantic-gov.org/Italy#belgianCitizenship"] memberOf _"http://www.semantic-gov.org/Italy#Person" Does this help you? Why this syntactic error in the axiom is not detected in wsmo4j before it is passed on to the reasoner is beyond me. Florian Wang, Xia wrote: > HI, dear Florian, > > I am so happy to hear from you. Thanks. > > It is a query for wsml web services. Problems are caused when I try to > get pre/postconditions from webserivices and transfer them to axioms, in > order to add into an ontology. The reasoner can not register the created > ontology. Error message includes "IS BOOLEAN", "Disjunction", or "IS > DECIMAL" ect. > For my case, the problem is because >> " axiom _# definedBy >> ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" hasValue ?cit] memberOf _"http://www.semantic-gov.org/Italy#Person" and ?cit = _"http://www.semantic-gov.org/Italy#belgianCitizenship"." > > causes "IS BOOLEAN" problem, the ontology can not register and the query > can not execute. > > Maybe "=, or" or any complex expression can not appear in the ontology. > So that do you know any way to transfer the pre/postconditions to axiom > with complex logicexpression, e.g, "age> 18"? > > By the way, > >>>> - What version of IRIS and respectively WSML2Reasoner are you using? > > I use the latest iris-20080604 and WSML2Reasoner20080218. > > - How does your java code look/how do you use WSML2Reasoner? > The code is as: > --------------------------------- > try { > Capability cap = serviceDescr.getCapability(); > > Set<Axiom> preSet = cap.listPreConditions(); > System.out.println("Precond " +preSet.size()); > if (preSet != null) > for (Axiom axiom : preSet) { > descr.addAxiom(axiom); > } > > } catch (InvalidModelException e) { > logger.error("Invalid model found on service or goal " > + serviceDescr.getIdentifier()); > e.printStackTrace();} > > return descr; //Ontology > } > > ------------------------------ > > > >>>> - What language variant is created ontology of? (Semantic-gov.org is > >>>> currently unreachable for some reason) I am slightly disturbed by the > >>>> unification operator ("=") in the axiom as that is not supposed to appear in the head of formula (in WSML-Flight and WSML-Rule) > >>>> Removing the axiom and trying the query you included gives me >>>> ?x _"http://www.semantic-gov.org/Italy#test" as result. > > I have removed the head of wsml-flight or wsml-rule to test. > > Still, my created ontology can not register. Do you have any > suggestions? > > Bests, > > Xia > > > > > > > -----Original Message----- > From: Florian Fischer [mailto:flo...@st...] Sent: 30 July 2008 11:51 > To: Wang, Xia > Cc: iri...@li... > Subject: Re: [iris-reasoner-support] Request for support > > Hi, > just a couple of quick questions: > - What version of IRIS and respectively WSML2Reasoner are you using? > - How does your java code look/how do you use WSML2Reasoner? > - What language variant is created ontology of? (Semantic-gov.org is currently unreachable for some reason) I am slightly disturbed by the unification operator ("=") in the axiom as that is not supposed to appear in the head of formula (in WSML-Flight and WSML-Rule) > > Removing the axiom and trying the query you included gives me > ?x > _"http://www.semantic-gov.org/Italy#test" > as result. > > Best, > Florian > > Wang, Xia wrote: >> Hi, dear guys, >> >> >> >> Can you give me any hint for my problems of IRIS reasoner. >> >> >> >> The following is the created ontology by merging the wsmo ontology and > >> its webservices ontology. >> >> >> >> Looking forward your help, >> >> >> >> xia >> >> > ------------------------------------------------------------------------ > - >> >> >> ontology _"http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml" >> >> >> >> importsOntology >> >> { _"http://www.semantic-gov.org/Belgium#GeaInstancesForPAServices", >> >> > _"http://www.wsmx.org/discovery/ontology-927853657218181539", >> > _"http://www.semantic-gov.org/Italy#PA_Turin_BelgiumChangeResidenceServi > ce_gea"} >> >> >> axiom _# >> >> definedBy >> >> ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" hasValue ?cit] memberOf _"http://www.semantic-gov.org/Italy#Person" >> >> and ?cit = _"http://www.semantic-gov.org/Italy#belgianCitizenship". >> >> >> >> instance _"http://www.semantic-gov.org/Italy#test" memberOf { _"http://www.semantic-gov.org/Italy#TurinPoliceService", _"http://www.semantic-gov.org/Ontologies/GEA#PublicService"} >> >> > _"http://www.semantic-gov.org/Ontologies/GEA#hasPublicServiceType" >> hasValue {_"http://www.semantic-gov.org/Belgium#ControlService", _"http://www.semantic-gov.org/Belgium#BelgianCitizenChangeResidence" } >> >> _"http://www.semantic-gov.org/Ontologies/GEA#hasPADomain" > hasValue >> {_"http://www.semantic-gov.org/Belgium#SecurityService", _"http://www.semantic-gov.org/Belgium#CitizenResidence" } >> >> _"http://www.semantic-gov.org/Ontologies/GEA#hasAdministrationLevel" hasValue {_"http://www.semantic-gov.org/Belgium#Local", _"http://www.semantic-gov.org/Belgium#European" } >> >> _"http://www.semantic-gov.org/Ontologies/GEA#hasLocation" > hasValue >> {_"http://www.semantic-gov.org/Belgium#PAServiceEntryPoint", _"http://www.semantic-gov.org/Belgium#NotAvailable" } >> >> _"http://www.semantic-gov.org/Ontologies/GEA#isGovernedByLaw" hasValue _"http://www.semantic-gov.org/Belgium#CivilCode_Art43" >> >> _"http://www.semantic-gov.org/Ontologies/GEA#hasEffectType" hasValue > _"http://www.semantic-gov.org/Belgium#UpdateResidenceInformation" >> >> >> >> >> -------The BaseOnto is ready and the query starts now! >> >> >> >> >> >> ****query is: >> >> ?x memberOf > _"http://www.semantic-gov.org/Ontologies/GEA#PublicService" . >> >> >> ???? > http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml >> _java.lang.IllegalArgumentException_: Can not evaluate a IS_BOOLEAN > with >> more than 0 variables (had 1). >> >> at org.deri.iris.builtins.AbstractBuiltin.evaluate(Unknown > Source) >> at org.deri.iris.rules.compiler.Builtin.process(Unknown Source) >> >> at org.deri.iris.rules.compiler.CompiledRule.evaluate(Unknown > Source) >> at > org.deri.iris.evaluation.seminaive.SemiNaiveEvaluator.evaluateRules(Unkn > own >> Source) >> >> at > org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluation > Strategy.<init>(Unknown >> Source) >> >> at > org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluation > StrategyFactory.createEvaluator(Unknown >> Source) >> >> at org.deri.iris.KnowledgeBase.<init>(Unknown Source) >> >> at > org.deri.iris.KnowledgeBaseFactory.createKnowledgeBase(Unknown >> Source) >> >> at > org.wsml.reasoner.builtin.iris.IrisFacade.register(_IrisFacade.java:401_ > ) >> at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologiesNoVeri > fication(_DatalogBasedWSMLReasoner.java:981_) >> at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologies(_Data > logBasedWSMLReasoner.java:674_) >> at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntology(_Datalo > gBasedWSMLReasoner.java:670_) >> at newpa.CheckBaseOnto.executequery(_CheckBaseOnto.java:109_) >> >> at newpa.CheckBaseOnto.run(_CheckBaseOnto.java:84_) >> >> at newpa.Query.run(_Query.java:41_) >> >> at newpa.Test.main(_Test.java:21_) >> >> >> >> >> >> >> >> >> > ------------------------------------------------------------------------ >> > ------------------------------------------------------------------------ > - >> This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge >> Build the coolest Linux based applications with Moblin SDK & win great > prizes >> Grand prize is a trip for two to an Open Source event anywhere in the > world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> >> >> > ------------------------------------------------------------------------ >> _______________________________________________ >> iris-reasoner-support mailing list >> iri...@li... >> https://lists.sourceforge.net/lists/listinfo/iris-reasoner-support |
From: Florian F. <flo...@st...> - 2008-07-30 11:07:26
|
Hi, just a couple of quick questions: - What version of IRIS and respectively WSML2Reasoner are you using? - How does your java code look/how do you use WSML2Reasoner? - What language variant is created ontology of? (Semantic-gov.org is currently unreachable for some reason) I am slightly disturbed by the unification operator ("=") in the axiom as that is not supposed to appear in the head of formula (in WSML-Flight and WSML-Rule) Removing the axiom and trying the query you included gives me ?x _"http://www.semantic-gov.org/Italy#test" as result. Best, Florian Wang, Xia wrote: > Hi, dear guys, > > > > Can you give me any hint for my problems of IRIS reasoner. > > > > The following is the created ontology by merging the wsmo ontology and > its webservices ontology. > > > > Looking forward your help, > > > > xia > > ------------------------------------------------------------------------- > > > > ontology > _"http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml" > > > > importsOntology > > { > _"http://www.semantic-gov.org/Belgium#GeaInstancesForPAServices", > > _"http://www.wsmx.org/discovery/ontology-927853657218181539", > > > _"http://www.semantic-gov.org/Italy#PA_Turin_BelgiumChangeResidenceService_gea"} > > > > axiom _# > > definedBy > > ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" > hasValue ?cit] memberOf _"http://www.semantic-gov.org/Italy#Person" > > and ?cit = _"http://www.semantic-gov.org/Italy#belgianCitizenship". > > > > instance _"http://www.semantic-gov.org/Italy#test" memberOf { > _"http://www.semantic-gov.org/Italy#TurinPoliceService", > _"http://www.semantic-gov.org/Ontologies/GEA#PublicService"} > > _"http://www.semantic-gov.org/Ontologies/GEA#hasPublicServiceType" > hasValue {_"http://www.semantic-gov.org/Belgium#ControlService", > _"http://www.semantic-gov.org/Belgium#BelgianCitizenChangeResidence" } > > _"http://www.semantic-gov.org/Ontologies/GEA#hasPADomain" hasValue > {_"http://www.semantic-gov.org/Belgium#SecurityService", > _"http://www.semantic-gov.org/Belgium#CitizenResidence" } > > > _"http://www.semantic-gov.org/Ontologies/GEA#hasAdministrationLevel" > hasValue {_"http://www.semantic-gov.org/Belgium#Local", > _"http://www.semantic-gov.org/Belgium#European" } > > _"http://www.semantic-gov.org/Ontologies/GEA#hasLocation" hasValue > {_"http://www.semantic-gov.org/Belgium#PAServiceEntryPoint", > _"http://www.semantic-gov.org/Belgium#NotAvailable" } > > _"http://www.semantic-gov.org/Ontologies/GEA#isGovernedByLaw" > hasValue _"http://www.semantic-gov.org/Belgium#CivilCode_Art43" > > _"http://www.semantic-gov.org/Ontologies/GEA#hasEffectType" > hasValue _"http://www.semantic-gov.org/Belgium#UpdateResidenceInformation" > > > > > > -------The BaseOnto is ready and the query starts now! > > > > > > ****query is: > > ?x memberOf _"http://www.semantic-gov.org/Ontologies/GEA#PublicService" . > > > > ???? http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml > > _java.lang.IllegalArgumentException_: Can not evaluate a IS_BOOLEAN with > more than 0 variables (had 1). > > at org.deri.iris.builtins.AbstractBuiltin.evaluate(Unknown Source) > > at org.deri.iris.rules.compiler.Builtin.process(Unknown Source) > > at org.deri.iris.rules.compiler.CompiledRule.evaluate(Unknown Source) > > at > org.deri.iris.evaluation.seminaive.SemiNaiveEvaluator.evaluateRules(Unknown > Source) > > at > org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluationStrategy.<init>(Unknown > Source) > > at > org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluationStrategyFactory.createEvaluator(Unknown > Source) > > at org.deri.iris.KnowledgeBase.<init>(Unknown Source) > > at org.deri.iris.KnowledgeBaseFactory.createKnowledgeBase(Unknown > Source) > > at > org.wsml.reasoner.builtin.iris.IrisFacade.register(_IrisFacade.java:401_) > > at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologiesNoVerification(_DatalogBasedWSMLReasoner.java:981_) > > at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologies(_DatalogBasedWSMLReasoner.java:674_) > > at > org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntology(_DatalogBasedWSMLReasoner.java:670_) > > at newpa.CheckBaseOnto.executequery(_CheckBaseOnto.java:109_) > > at newpa.CheckBaseOnto.run(_CheckBaseOnto.java:84_) > > at newpa.Query.run(_Query.java:41_) > > at newpa.Test.main(_Test.java:21_) > > > > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > iris-reasoner-support mailing list > iri...@li... > https://lists.sourceforge.net/lists/listinfo/iris-reasoner-support |
From: Wang, X. <xia...@de...> - 2008-07-30 10:11:57
|
Hi, dear guys, Can you give me any hint for my problems of IRIS reasoner. The following is the created ontology by merging the wsmo ontology and its webservices ontology. Looking forward your help, xia ------------------------------------------------------------------------ - ontology _"http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml" importsOntology { _"http://www.semantic-gov.org/Belgium#GeaInstancesForPAServices", _"http://www.wsmx.org/discovery/ontology-927853657218181539", _"http://www.semantic-gov.org/Italy#PA_Turin_BelgiumChangeResidenceServi ce_gea"} axiom _# definedBy ?person[_"http://www.semantic-gov.org/Italy#hasCitizenship" hasValue ?cit] memberOf _"http://www.semantic-gov.org/Italy#Person" and ?cit = _"http://www.semantic-gov.org/Italy#belgianCitizenship". instance _"http://www.semantic-gov.org/Italy#test" memberOf { _"http://www.semantic-gov.org/Italy#TurinPoliceService", _"http://www.semantic-gov.org/Ontologies/GEA#PublicService"} _"http://www.semantic-gov.org/Ontologies/GEA#hasPublicServiceType" hasValue {_"http://www.semantic-gov.org/Belgium#ControlService", _"http://www.semantic-gov.org/Belgium#BelgianCitizenChangeResidence" } _"http://www.semantic-gov.org/Ontologies/GEA#hasPADomain" hasValue {_"http://www.semantic-gov.org/Belgium#SecurityService", _"http://www.semantic-gov.org/Belgium#CitizenResidence" } _"http://www.semantic-gov.org/Ontologies/GEA#hasAdministrationLevel" hasValue {_"http://www.semantic-gov.org/Belgium#Local", _"http://www.semantic-gov.org/Belgium#European" } _"http://www.semantic-gov.org/Ontologies/GEA#hasLocation" hasValue {_"http://www.semantic-gov.org/Belgium#PAServiceEntryPoint", _"http://www.semantic-gov.org/Belgium#NotAvailable" } _"http://www.semantic-gov.org/Ontologies/GEA#isGovernedByLaw" hasValue _"http://www.semantic-gov.org/Belgium#CivilCode_Art43" _"http://www.semantic-gov.org/Ontologies/GEA#hasEffectType" hasValue _"http://www.semantic-gov.org/Belgium#UpdateResidenceInformation" -------The BaseOnto is ready and the query starts now! ****query is: ?x memberOf _"http://www.semantic-gov.org/Ontologies/GEA#PublicService" . ???? http://www.wsmx.org/discovery/tempOntology-927853657218181538.wsml java.lang.IllegalArgumentException: Can not evaluate a IS_BOOLEAN with more than 0 variables (had 1). at org.deri.iris.builtins.AbstractBuiltin.evaluate(Unknown Source) at org.deri.iris.rules.compiler.Builtin.process(Unknown Source) at org.deri.iris.rules.compiler.CompiledRule.evaluate(Unknown Source) at org.deri.iris.evaluation.seminaive.SemiNaiveEvaluator.evaluateRules(Unkn own Source) at org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluation Strategy.<init>(Unknown Source) at org.deri.iris.evaluation.stratifiedbottomup.StratifiedBottomUpEvaluation StrategyFactory.createEvaluator(Unknown Source) at org.deri.iris.KnowledgeBase.<init>(Unknown Source) at org.deri.iris.KnowledgeBaseFactory.createKnowledgeBase(Unknown Source) at org.wsml.reasoner.builtin.iris.IrisFacade.register(IrisFacade.java:401) at org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologiesNoVeri fication(DatalogBasedWSMLReasoner.java:981) at org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntologies(Datal ogBasedWSMLReasoner.java:674) at org.wsml.reasoner.impl.DatalogBasedWSMLReasoner.registerOntology(Datalog BasedWSMLReasoner.java:670) at newpa.CheckBaseOnto.executequery(CheckBaseOnto.java:109) at newpa.CheckBaseOnto.run(CheckBaseOnto.java:84) at newpa.Query.run(Query.java:41) at newpa.Test.main(Test.java:21) |
From: Martin B. <mar...@gm...> - 2008-04-29 19:08:57
|
Hi, (Any idea why our emails don't appear in the sf archive?) I just updated my checkout of IRIS and had to update my patch of the parser because of conflicts in iris.scc. Here is the new version. Cheers, -- Martin Bravenboer --------------------------------------------------------------------- Department of Computer and Information Science University of Oregon |
From: Barry B. <bar...@st...> - 2008-04-29 07:41:56
|
Hi Martin, Thanks for the encouraging words, but sorry to hear that you have run in to memory problems. You are not alone in this any we have work scheduled for improving the memory consumption (there are a number of tricks for this) and also possibly implementing a database backed relation class. However, currently we are snowed under with non-IRIS related tasks and must postpone things for a short time. Regarding the memory consumption, IRIS is not very sophisticated and could easily be modified so that: 1. every term is unique 2. every unique combination of terms (i.e. a tuple) is also unique This might slow things down a little bit, but should save a lot of memory too, since really all a datalog evaluation does is recombine existing terms in different ways. So yes, we plan for IRIS to be able to manage evaluations involving millions of facts, but some more work needs to be done. Thanks again for your interest, Barry Bishop Senior Scientific Programmer Semantic Technology Institute (STI) University of Innsbruck, Austria ----------------------------------- E-Mail: bar...@st... Tel: +43 512 507 96873 ----------------------------------- Martin Bravenboer wrote: > Hi all, > > I started using IRIS because it's very user-friendly and supports a > lot of datatypes. The educational value of IRIS is definitely great. > > I have been running very small experiments until now, but in the long > run my Datalog programs need to scale to relations with millions of > tuples. I do not exactly expect IRIS to handle that, but I was hoping > that I could at least keep using IRIS for medium-size problems with > relations of a few 100k and compare the results to the results of > other Datalog engines. > > Unfortunately my medium-sized tests, with 200k to 600k input facts all > result in out of memory errors for Datalog programs that are not > entirely trivial (i.e. involving a few joins). I've set the Java heap > size to 2048m. The biggest issues seems to be the SimpleRelation. > Java's stack trace usually shows an out of memory error while copying > arrays as a result of operations on SimpleRelation. > > So, I'm wondering, do you have any other implementations around for > IRelation that you haven't included in IRIS? Maybe backed up by a > database? > > Do you have any general advice for reducing the memory consumption? > > Maybe you could also say something about the scale you want to support > with IRIS? > > Thanks! > > Cheers, |
From: Martin B. <mar...@gm...> - 2008-04-29 07:05:07
|
Hi all, I started using IRIS because it's very user-friendly and supports a lot of datatypes. The educational value of IRIS is definitely great. I have been running very small experiments until now, but in the long run my Datalog programs need to scale to relations with millions of tuples. I do not exactly expect IRIS to handle that, but I was hoping that I could at least keep using IRIS for medium-size problems with relations of a few 100k and compare the results to the results of other Datalog engines. Unfortunately my medium-sized tests, with 200k to 600k input facts all result in out of memory errors for Datalog programs that are not entirely trivial (i.e. involving a few joins). I've set the Java heap size to 2048m. The biggest issues seems to be the SimpleRelation. Java's stack trace usually shows an out of memory error while copying arrays as a result of operations on SimpleRelation. So, I'm wondering, do you have any other implementations around for IRelation that you haven't included in IRIS? Maybe backed up by a database? Do you have any general advice for reducing the memory consumption? Maybe you could also say something about the scale you want to support with IRIS? Thanks! Cheers, -- Martin Bravenboer --------------------------------------------------------------------- Department of Computer and Information Science University of Oregon |
From: Martin B. <mar...@gm...> - 2008-04-29 06:12:52
|
Hi Barry, Thanks for your reply! (sorry for being a bit slow) > We will likely go for the 'always escaped' version, i.e. "\t" in an input > file always means "<tab>". > Further, to allow compatibility with other reasoners we will allow strings > to be delimited with " and ', however for simplicity/consistency both of > these characters will always need to be escaped inside a string Okay, sounds good to me. >> Is there support for checking if all predicates of a set of rules >> occur in a fact, or can be derived using a different rule? > Afraid so. There is no standard 'dataloggy' way to do this. I've implemented a small checker utility that analyses an IRIS Datalog program by generating a Datalog program at run-time. For a rule F(_, _) :- G(_), H(_, _, _) it generates a rule CanBeDerived("F", 2) :- CanBeDerived("G", 1), CanBeDerived("H", 3) and OccursInBody and OccursInHead facts. It then evaluates the queries: ?- OccursInBody(?s, ?x), not CanBeDerived(?s, ?x). ?- OccursInHead(?s, ?x), not CanBeDerived(?s, ?x). printing error messages if there are any results. It works fine for me (saved me quite some time finding stupid typos), but if it might be very specific for my needs. > Hmmm, this in an interesting idea. Something like C style > #include<filename> maybe? Yes, of course you could think of more advanced module system features, but an include would already be useful. > Of course, if you do have a C compiler installed you can just use the > pre-processor to do this kind of thing Good point :) Cheers, -- Martin Bravenboer --------------------------------------------------------------------- Department of Computer and Information Science University of Oregon |
From: Barry B. <bar...@st...> - 2008-04-10 06:55:39
|
Hi Martin! Congratulations on being the first IRIS user to use the support mailing list! :) Martin Bravenboer wrote: > Hi Richard, > > Thanks for your reply. > >> The project page is hosted on sf and there would also be >> some mailing list/forum stuff > > Right, I checked that place, but the mailing list didn't look active > to me. I've CC'ed the list this time. I've quoted most of the earlier > email for the record. It wasn't active, but I'm sure you've started the ball rolling now! >> > I'm using IRIS as a command-line tool that evaluates a Datalog >> > programs read from a file. I had a few problems with generating IRIS >> > Datalog facts involving string literals from the programs that I want >> > to analyse. I've attached an update of iris.scc (as a complete file >> > and a patch, if you prefer that). The fixes are: >> > >> > 1) eol optional in an eol comment (otherwise an eol comment at the end >> > of the file doesn't parse). >> > >> > 2) introduced long comments /* ... */ >> > >> > 3) more flexible string literals: allow all characters, except for cr, >> > lf, ' and \. Those four characters can be escaped using \n, \r, \', >> > and \\. This fix is quite important for my applications. >> >> I will have a closer look about the changes and write some tests, when I got the >> time. After a review with Barry I can apply them. >> >> One question: >> >> Is this really the shortest/simplest way to write this? I tried to understand >> it, but I couldn't get trough it: >> >> long_comment = '/*' not_star* '*'+ (not_star_slash not_star* '*'+)* '/'; >> >> wouldn't >> >> long_comment = '/*' not_star_slash* '*/'; >> >> do the same thing? > > This definition is the common way of defining long comments in > Java-like languages. If you check the SableCC grammar of Java, etc, > you will see something very similar. > > Your version would not allow a * and / at all in the comment. For > example, this would reject the useful Javadoc style: > > /** > * > */ > > I'm using these comments right now to document my rules. Thanks for your all suggestions here. We have been planning to do something about these for some time, but no-one had got around to it. We will likely be making a new release of IRIS in the coming week or two and hope to incorporate most of your ideas. >> > I thought about supporting more character escapes (like \t), but this >> > is a bit more complex. I considered to unescape the string literal in >> > the TreeWalker, but string are used in many places. Worse, they need >> > to be escaped again when printed somewhere (e.g. to print results to a >> > file). There is no clean place to do escaping at the moment (because >> > strings are used in many places), so I decided that keeping the >> > special characters escaped would be more convenient. Using escaped >> > characters at run-time works fine: it doesn't matter if the special >> > characters are escaped or not in the runtime representation of a >> > string. >> >> During the runtime it doesn't matter, whether they are escaped, or not, because >> IRIS uses the ordinary String.compare(...) or String.equals(...) methods. Imho >> to enable those escaped characters it would only be necessary to edit the string >> term handling in the tree walker and the toString() method of the string term to >> handle them. Or did you experience something different? > > No, this is more or less the problem yeah. It doesn't matter if the > characters are escaped or not, as long as they are *always* escaped or > not. We will likely go for the 'always escaped' version, i.e. "\t" in an input file always means "<tab>". Further, to allow compatibility with other reasoners we will allow strings to be delimited with " and ', however for simplicity/consistency both of these characters will always need to be escaped inside a string >> > 1) Is there support for checking if all predicates of a set of rules >> > occur in a fact, or can be derived using a different rule? I just want >> > a simple warning if there is a typo in a predicate name. If there is >> > no such thing, then I can easily implement it myself, but I just >> > wanted to check with you first. >> >> Imho there is no such possibility, at the moment. > > Okay, thanks, I'll implement it myself then. Afraid so. There is no standard 'dataloggy' way to do this. >> > 2) Is there something like a wildcard? Sometimes, I don't care about a >> > certain element of a relation, like the variable ?sometype in >> > "MethodSignature(?signature, ?sometype, ?simplename, ?descriptor)". Is >> > it possible to use something like a _ instead of having to invent a >> > variable name? >> >> No, I know only the unique variable trick. But this could be implemented by a >> term, which is equal to everything (which is imho a more or less dirty hack). > > Okay, thanks. It would be very useful to have a wildcard feature. An > easier solution might be to replace wildcards with unique variable > names? No plans for this just yet! > Another question: do you have any plans/ideas about an include/import > feature for Datalog files? I'm defining variants of some datalog > specifications, and I find myself copying sets of rules now and then. > It would be nice if I could save these in a separate file and import > them. Hmmm, this in an interesting idea. Something like C style #include<filename> maybe? Of course, if you do have a C compiler installed you can just use the pre-processor to do this kind of thing, e.g. d1.txt ------ p(?x) :- q(?x). d2.txt ------ #include "d1.txt" q(1). ?- q(?x). gcc -E -x c d2.txt | grep -v '#' -------------------------------- p(?x) :- q(?x). q(1). ?- q(?x). You could also create macros and have conditional compilation, etc. Well, just a thought... Thanks again for your interest. Regards, Barry Bishop Senior Scientific Programmer Semantic Technology Institute (STI) University of Innsbruck, Austria ----------------------------------- E-Mail: bar...@st... Tel: +43 512 507 96873 ----------------------------------- |
From: Martin B. <mar...@gm...> - 2008-04-10 00:44:12
|
Hi Richard, Thanks for your reply. > The project page is hosted on sf and there would also be > some mailing list/forum stuff Right, I checked that place, but the mailing list didn't look active to me. I've CC'ed the list this time. I've quoted most of the earlier email for the record. > > I'm using IRIS as a command-line tool that evaluates a Datalog > > programs read from a file. I had a few problems with generating IRIS > > Datalog facts involving string literals from the programs that I want > > to analyse. I've attached an update of iris.scc (as a complete file > > and a patch, if you prefer that). The fixes are: > > > > 1) eol optional in an eol comment (otherwise an eol comment at the end > > of the file doesn't parse). > > > > 2) introduced long comments /* ... */ > > > > 3) more flexible string literals: allow all characters, except for cr, > > lf, ' and \. Those four characters can be escaped using \n, \r, \', > > and \\. This fix is quite important for my applications. > > I will have a closer look about the changes and write some tests, when I got the > time. After a review with Barry I can apply them. > > One question: > > Is this really the shortest/simplest way to write this? I tried to understand > it, but I couldn't get trough it: > > long_comment = '/*' not_star* '*'+ (not_star_slash not_star* '*'+)* '/'; > > wouldn't > > long_comment = '/*' not_star_slash* '*/'; > > do the same thing? This definition is the common way of defining long comments in Java-like languages. If you check the SableCC grammar of Java, etc, you will see something very similar. Your version would not allow a * and / at all in the comment. For example, this would reject the useful Javadoc style: /** * */ I'm using these comments right now to document my rules. > > I thought about supporting more character escapes (like \t), but this > > is a bit more complex. I considered to unescape the string literal in > > the TreeWalker, but string are used in many places. Worse, they need > > to be escaped again when printed somewhere (e.g. to print results to a > > file). There is no clean place to do escaping at the moment (because > > strings are used in many places), so I decided that keeping the > > special characters escaped would be more convenient. Using escaped > > characters at run-time works fine: it doesn't matter if the special > > characters are escaped or not in the runtime representation of a > > string. > > During the runtime it doesn't matter, whether they are escaped, or not, because > IRIS uses the ordinary String.compare(...) or String.equals(...) methods. Imho > to enable those escaped characters it would only be necessary to edit the string > term handling in the tree walker and the toString() method of the string term to > handle them. Or did you experience something different? No, this is more or less the problem yeah. It doesn't matter if the characters are escaped or not, as long as they are *always* escaped or not. > > 1) Is there support for checking if all predicates of a set of rules > > occur in a fact, or can be derived using a different rule? I just want > > a simple warning if there is a typo in a predicate name. If there is > > no such thing, then I can easily implement it myself, but I just > > wanted to check with you first. > > Imho there is no such possibility, at the moment. Okay, thanks, I'll implement it myself then. > > 2) Is there something like a wildcard? Sometimes, I don't care about a > > certain element of a relation, like the variable ?sometype in > > "MethodSignature(?signature, ?sometype, ?simplename, ?descriptor)". Is > > it possible to use something like a _ instead of having to invent a > > variable name? > > No, I know only the unique variable trick. But this could be implemented by a > term, which is equal to everything (which is imho a more or less dirty hack). Okay, thanks. It would be very useful to have a wildcard feature. An easier solution might be to replace wildcards with unique variable names? Another question: do you have any plans/ideas about an include/import feature for Datalog files? I'm defining variants of some datalog specifications, and I find myself copying sets of rules now and then. It would be nice if I could save these in a separate file and import them. Cheers, -- Martin Bravenboer --------------------------------------------------------------------- Department of Computer and Information Science University of Oregon |
From: Barry B. <bar...@de...> - 2007-09-06 13:08:06
|
Just testing! |