|
From: <fra...@us...> - 2009-08-11 20:43:19
|
Revision: 1821
http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1821&view=rev
Author: frankrimlinger
Date: 2009-08-11 20:43:12 +0000 (Tue, 11 Aug 2009)
Log Message:
-----------
Fixed requirement type bug. Only MINIMAL types are allowed. If your putative type isn't minimal, then you can't have a type at all, and the requirement becomes a wildcard. To enforce, used reflection to call getRequirementType() for each requirement and explicitly check the requirement for minimality. User then has the chance to fix any errors.
With this in place, achieving a unifier calls/matches rate of around 30-40%, about 1000 times the previous rate. The actual speed up in rewriter throughput is observable but not large, but a drag on scalability of the rule base has definitely been eliminated.
NEXT BUG: the devil must have his due. The gradation by requirement types is based on the "fact" that an object has at most one minimal type. But it ain't necessarily so. In particular, a LocalVarSym might have the minimal types int[] and <localVar>. Fortunately, there really is no need for a <localVar> to have such specific type information. We did this to get some translation capability on-the-cheap. Evidently the translator just has to work harder, and <localVar>s have to stick with the generic non-minimal types like <integralValue> and <object>.
There is a charming indeterminacy when an object has multiple minimal types. Sometimes the filter will get the "right" type and the rewriter will succeed, and other times the rewriter will fail. This has to do with the fact that order within a HashSet is highly indeterminate. To guard against this problem, multiple minimal types for an object must be detected during the request for minimal type and cause an IllegalStateException or at least a stern warning.
Modified Paths:
--------------
branches/mango/Mango/Mango/src/mango/core/RuleResourceManager.java
branches/mango/Mango/Mango/src/mango/ruleRequirement/typing/PredTransformerReq.java
branches/mango/Mango/Mango/src/mango/worker/engine/events/RewriteEvent.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/Pair.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/Req.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/Rule.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/RuleFilterManager.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/Tier.java
branches/mango/Mango/Mango/src/mango/worker/engine/unifier/ActionCallBack.java
branches/mango/Mango/Mango/src/mango/worker/msg/RulebaseMsg.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/msg/ShowTypeRequestMsg.java
branches/mango/Mango/javapathfinder-mango-bridge/mango/FormalTypes.java
branches/mango/Mango/mangoUserHome/frank/rules/rulebase.zip
branches/mango/Mango/mangoUserHome/frank/sessions/a.zip
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|