Source Code Cross Referenced for Calculus.java in  » Testing » KeY » de » uka » ilkd » key » counterexample » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » KeY » de.uka.ilkd.key.counterexample 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // This file is part of KeY - Integrated Deductive Software Design
002:        // Copyright (C) 2001-2007 Universitaet Karlsruhe, Germany
003:        //                         Universitaet Koblenz-Landau, Germany
004:        //                         Chalmers University of Technology, Sweden
005:        //
006:        // The KeY system is protected by the GNU General Public License. 
007:        // See LICENSE.TXT for details.
008:        //
009:        //
010:        //
011:
012:        package de.uka.ilkd.key.counterexample;
013:
014:        /**
015:         * The root of the Calculus Hierarchy, this class only produces the static
016:         * clauses which are the same for all problems. The subclasses generate the further clauses.
017:         * @see SortCalculus
018:         * @see AxiomCalculus
019:         * @see ConjCalculus
020:         * @author Sonja Pieper
021:         * @version 0.1 
022:         */
023:        public class Calculus {
024:
025:            private Clauses statics;
026:            protected Clauses all;
027:
028:            public Calculus() {
029:
030:                statics = new Clauses();
031:                statics.add(this .domainbound());
032:                statics.add(this .functionality());
033:                statics.add(this .sameRewriting());
034:                statics.add(this .resultRewriting());
035:                statics.add(this .argRewriting());
036:
037:                all = new Clauses();
038:                this .addClauses(statics);
039:            }
040:
041:            public void addClauses(Clauses c) {
042:                this .all.add(c);
043:            }
044:
045:            public Clauses getStaticClauses() {
046:                return statics;
047:            }
048:
049:            public Clauses getAllClauses() {
050:                return all;
051:            }
052:
053:            private Clauses domainbound() {
054:                Clauses cs = new Clauses();
055:                cs.add(new Clause("", "max(" + CounterExample.config.domainmax
056:                        + ")"));
057:                return cs;
058:            }
059:
060:            private Clauses functionality() {
061:                Clauses cs = new Clauses();
062:                cs.add(new Clause("intpr(F,X,Y),intpr(F,X,Y1),{Y\\==Y1}",
063:                        "same(Y,Y1)", "Functionality"));
064:                cs.add(new Clause("is(X,Y),is(X,Y1),{Y\\==Y1}", "same(Y,Y1)"));
065:                return cs;
066:            }
067:
068:            private Clauses sameRewriting() {
069:                Clauses cs = new Clauses();
070:                cs.add(new Clause("same(X,Y),is(X,Z)", "same(Z,Y)",
071:                        "Rewriting with same"));
072:                cs.add(new Clause("same(X,Y),is(Y,Z)", "same(Z,X)"));
073:                cs.add(new Clause("different(X,Y),is(X,Z)", "different(Z,Y)",
074:                        "Rewriting with different"));
075:                cs.add(new Clause("different(X,Y),is(Y,Z)", "different(Z,X)"));
076:                return cs;
077:            }
078:
079:            private Clauses resultRewriting() {
080:                Clauses cs = new Clauses();
081:                cs.add(new Clause("intpr(F,X,Y),is(Y,Y1)", "intpr(F,X,Y1)",
082:                        "Result rewriting"));
083:                return cs;
084:            }
085:
086:            Clauses argRewriting() {
087:                Clauses cs = new Clauses();
088:
089:                /* rewriting rules where n is the number of args currently produced*/
090:                for (int n = 0; n <= CounterExample.config.maxargs; n++) {
091:
092:                    if (n > 0) {
093:                        cs.addComment("Rewriting for functions with " + n
094:                                + " arguments");
095:                    }
096:
097:                    for (int current_arg = 0; current_arg < n; current_arg++) {
098:                        String args = new String();
099:                        String rewargs = new String();
100:                        for (int i = 1; i <= n; i++) {
101:                            args = args + "X" + i;
102:                            rewargs = (i == current_arg ? "Z" : "X" + i);
103:                        }
104:                        String aconj = "is(X" + current_arg + ",Z),intpr(F,tup"
105:                                + n + "(" + args + "),Y)";
106:                        String cnsq = "intpr(F,tup" + n + "(" + rewargs
107:                                + "),Y)";
108:
109:                        Clause rewrite_current_arg = new Clause(aconj, cnsq);
110:                        cs.add(rewrite_current_arg);
111:                    }
112:                }
113:
114:                return cs;
115:            }
116:
117:            public String toString() {
118:                return all.toString();
119:            }
120:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.