|
From: <fra...@us...> - 2009-07-30 00:41:55
|
Revision: 1790
http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1790&view=rev
Author: frankrimlinger
Date: 2009-07-30 00:41:46 +0000 (Thu, 30 Jul 2009)
Log Message:
-----------
Revised Kons.getAssignedTypes so that if the rulekey x is NOT a type, but x has assigned types, then those types are also assigned to the Kons. This revision allows the "short names" for functions to propagate the <exposed> type to function instantiations without actually introducing the short names into the type namespace, which is already getting crowded. However, it is no longer a good idea to designate ANY rulekey as immutable, and in fact all such designations have been removed. In the end, it may be necessary to introduced levels into the type namespace in order to avoid collisions, but this is fraught with peril. It is much safer to dynamically assign types then to dynamically create new types, and maybe this is good enough.
Fixed Kons.getAssignedTypes so that it no longer wastes memory. Its ok to have a secondary hash to store the HashSets as long as you UPDATE the retrieved set each time.
There is another point here, that has to do with timing. Type assignment RuleKey.getAssignedTypes() guarantees that associated Kons items will learn the type *before* any requirement fires on that Kons. This is critical for the newly introduced rewriter types like <notWithDiveCommuter> and <binder>. This technique captures the essence of all the hacks used to "get out in front" of the rewriter in a systematic way.
Removed all the type delegates for Kons. This hack is really no longer necessary now that a Kons inherits type from its rulekey.
The cleanest way to assign type to SymbolHash fields is simply to add the corresponding "known implication" to FormalTypes. To this end, method FormalTypes.buildInitialImplications() is called during initialization of the FormalTypes object. In a way, we are recreating the old SymbolHash initialization method, but at least now all the really funky stuff is localized in FormalTypes, which has become a kind "nerve center" for Mango. In fact, this class should be reincarnated as a plugin some day.
CAVEAT EMPTOR: Don't assign types to a type, this is what the partial order is for!
Removed ugly code from getAssignedTypes() methods and localized in buildInitialImplications().
Completed rulebase rehab. Port of hacks to typing system now complete. Session replay is ok for forName, at least up to parametrization. This means that the new typing system is getting it done.
NEXT BUG: Typing is now so aggressive that 't and 'f are recognized as <predicate> and therefore as <parameter>, which causes a bug because they have no minimal type. This needs some thought.
TODO introduce types <freeStateVariable> and <dummyStateVariable>. Something I have wanted to do for a long long time is now possible.
Modified Paths:
--------------
branches/mango/Mango/Mango/src/mango/Resources/IconIndex.java
branches/mango/Mango/Mango/src/mango/core/CoreRule.java
branches/mango/Mango/Mango/src/mango/core/sym/RuleKey.java
branches/mango/Mango/Mango/src/mango/ruleAction/conditionalTechniques/conditional/HYPO.java
branches/mango/Mango/Mango/src/mango/ruleAction/function/engine/EvaluatePredicate.java
branches/mango/Mango/Mango/src/mango/ruleAction/function/theory/ModelHeapVacuum.java
branches/mango/Mango/Mango/src/mango/ruleAction/function/theory/ModelHeapVacuum012.java
branches/mango/Mango/Mango/src/mango/ruleAction/function/theory/ModelHeapVacuum02.java
branches/mango/Mango/Mango/src/mango/ruleAction/function/theory/ModelHeapVacuumA.java
branches/mango/Mango/Mango/src/mango/util/LOG.java
branches/mango/Mango/Mango/src/mango/worker/Worker.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/DoubleH.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/FloatH.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/Hash.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/Hitem.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/IntegerH.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/Kons.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/LongH.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/symbolHash/SymbolHashRewriter.java
branches/mango/Mango/Mango/src/mango/worker/engine/hash/symbolHash/SymbolHashTyping.java
branches/mango/Mango/Mango/src/mango/worker/engine/rule/Rule.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/ClinitWasCalledSym.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/GenericMethodNameSym.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/ImmutableSym.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/InstructionNameSym.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/Marker.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/Other.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/Plug.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/Sym.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/coreTechniques/agent/HypoAgent.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/coreTechniques/model/HeapPointer.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/form/model/HeapItemModel.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/form/model/LocalVarModel.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/form/sym/binder/ContextBinderSym.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/form/sym/binder/executable/LocalVarSym.java
branches/mango/Mango/Mango/src/mango/worker/workFlow/functionSpace/agent/EvaluatePredicateAgent.java
branches/mango/Mango/javapathfinder-mango-bridge/mango/FormalTypes.java
branches/mango/Mango/javapathfinder-mango-bridge/mango/scanner/MangoMethodPeer.java
branches/mango/Mango/javapathfinder-mango-bridge/mango/scanner/sym/JclassSym.java
branches/mango/Mango/mangoUserHome/frank/rules/rulebase.zip
Added Paths:
-----------
branches/mango/Mango/Mango/src/mango/ruleAction/simpleSubstitution/AutomaticSubstitution.java
branches/mango/Mango/Mango/src/mango/ruleAction/simpleSubstitution/Substitution.java
branches/mango/Mango/Mango/src/mango/ruleAction/typeAssignment/AssignNotObjectValue.java
branches/mango/Mango/Mango/src/mango/ruleRequirement/typing/NotObjectReq.java
branches/mango/Mango/Mango/src/mango/worker/engine/sym/ItemImplication.java
Removed Paths:
-------------
branches/mango/Mango/Mango/src/mango/ruleAction/simpleSubstitution/SUBR.java
branches/mango/Mango/Mango/src/mango/ruleAction/simpleSubstitution/SUBRautomatic.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|