Menu

#3 Reduce Domain Autotactic

open
Rodin Core (2)
5
2012-12-08
2011-07-07
No

Reduces a multi-element domain to individual elements by:
- rewriting dom().
- repeatedly removing individual memberships.

Discussion

  • Stephen Wright

    Stephen Wright - 2011-07-07

    org.eventb.core.seqprover\src\org\eventb\core\seqprover\eventbExtensions\AutoTactics.java

     
  • Stephen Wright

    Stephen Wright - 2011-07-07

    The following subroutine is also needed in BasicTactic.java

    public static ITactic loopOnAllPendingConditional\(final ITactic ... tactics\)\{
        // return repeat\(onAllPending\(composeUntilSuccess\(tactics\)\)\);
        return new ITactic\(\)\{
    
            public Object apply\(IProofTreeNode ptNode, IProofMonitor pm\) \{
    
                boolean modified = false;
    
                LinkedList<IProofTreeNode> nodes = new LinkedList<IProofTreeNode>\(Arrays.asList\(ptNode.getOpenDescendants\(\)\)\);
    
                while \(\! nodes.isEmpty\(\)\) \{
                    IProofTreeNode node = nodes.removeFirst\(\);
                    for \(ITactic tactic : tactics\) \{
                        tactic.apply\(node, pm\);
                        if \(\! node.isOpen\(\)\) \{
                            // tactic made some progress on node
                            modified = true;
                            nodes.addAll\(Arrays.asList\(node.getOpenDescendants\(\)\)\);
                        \}
                        else \{
                            break;
                        \}
                    \}
                \}
    
                if \(modified\)\{
                    return null;
                \} 
                else \{
                    return "loopOnAllPendingConditional: All tactics failed";
                \}
            \}
        \};
    
    \}
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.