From: <fra...@us...> - 2009-08-21 15:59:47
|
Revision: 1846 http://javapathfinder.svn.sourceforge.net/javapathfinder/?rev=1846&view=rev Author: frankrimlinger Date: 2009-08-21 15:59:32 +0000 (Fri, 21 Aug 2009) Log Message: ----------- The instanceof utility is now obsolete. As null cases are handled separately now anyway, we can use the checkcast utility. To get return value, we wrap the checkcast expression using the new pred2bool utility of type boolean. This relieves a lot of predicate-versus-boolean anxiety for the user. Moreover, we get to introduce the wonderful rule (= (pred2bool x) 0 ) --> (not x) which causes pred2bool to evaporate when forming hypotheses. It only shows up in value expressions, where it can just be dropped on translation. Lesson learned: Initially thought to introduce pred2bool as a formal type, with <pred2bool> -> boolean. But now boolean is no longer minimal, which fouls the rewriter. So, don't go "type happy". Not everything needs to be a type. If timing is not an issue, in that the rewriter has a chance to brand a kons with its type before it needs to know the type, then use a utility rulekey instead. There are probably a few types out there that should be demoted to utilities already. Modified Paths: -------------- branches/mango/Mango/Mango/src/mango/worker/engine/hash/symbolHash/SymbolHashOpcodeSyms.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/rule/Tier.java branches/mango/Mango/javapathfinder-mango-bridge/mango/scanner/bytecode/CHECKCAST.java branches/mango/Mango/javapathfinder-mango-bridge/mango/scanner/bytecode/INSTANCEOF.java branches/mango/Mango/mangoUserHome/frank/rules/rulebase.zip Removed Paths: ------------- branches/mango/Mango/Mango/src/mango/ruleAction/coreRewriter/classModel/Instanceof.java branches/mango/Mango/mangoUserHome/frank/bin/ branches/mango/Mango/mangoUserHome/marc/bin/ branches/mango/Mango/mangoUserHome/rkrug/bin/ branches/mango/Mango/mangoUserHome/system/bin/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |