Semantic Tableau Prover for Modal Logic

Size: px
Start display at page:

Download "Semantic Tableau Prover for Modal Logic"

Transcription

1 University of Manchester Third Year Project 2015 Semantic Tableau Prover for Modal Logic Student: Silviu Adi Pruteanu Supervisor: Dr. Renate Schmidt 1/34

2 Abstract This project report documents the extension of a Tableau Based Theorem Prover. The original system covers the operators of modal logic. The aim of the project is to extend the prover with multi-modal operators, frame conditions and blocking. All the main aims have been implemented and tested and there is only a small number of changes in the design of the original prover. Testing has revealed that the new system is slightly slower on short formulas and faster on long formulas that require a high number of operator expansions. 2/34

3 Acknowledgements I would like to take this opportunity to express my gratitude to those whose support has been invaluable to me throughout this project. To Dr. Renate Schmidt, my project supervisor, for providing excellent guidance on how to handle both the project and other issues. To Ruchika Mhaprolkar, for encouraging me to keep my spirits up during the more difficult parts of the project. And to my parents, for understanding my need for more privacy during the development of the project. 3/34

4 Contents 1 Introduction Background Modal Logic Multi-modal Logic Blocking Requirements analysis Existing System Extensions to the system Design The existing design Changes in the design Implementation Multi-modal Operators Frame Conditions Blocking Backtracking Code changes and Bug Fixes Results Input Output Testing Unit testing Blocking testing Prover testing Conclusion References /34

5 List of Figures Figure 2.1 Example of statement translated to logical formula... 8 Figure 2.2 Example of logical formula with operator... 8 Figure 2.3 Rules for proving the and operators... 9 Figure 2.4 Example of ϕ extending infinitely because of transitivity Figure 2.5 The Congruence Closure System Figure 2.6 Example of rewrite that shortens the proving time Figure 2.7 Example of rewrite causing a contradiction Figure 3.1 A model for the formula " a" Figure 3.2 The Tableau Prover's expansion rules Figure 3.3 The two types of Tableau Lines from Hanah Anderson's prover Figure 4.1 The main parts of Hanah Anderson's Tableau Prover Figure 4.2 The context free grammar for the parser Figure 4.3 The Main Window of the Tableau Prover Figure 4.4 The Three ways of to Add a Formula Figure 4.5 The Tableau Window of Hanah Anderson's Prover Figure 4.6 C rule line in the derivation Figure 4.7 An extended model that includes C rule information Figure 4.8 The extended derivation lines Figure 4.9 The redesigned Tableau Window Figure 5.1 Modal and multi-modal being expanded Figure 5.2 Transitive and Euclidean relations Figure 5.3 The Orientation, Deletion, Extension and Simplification rules Figure 5.4 The Deduction, Compression and Composition rules Figure 6.1 Screenshots of the two ways to parse a formula Figure 6.2 Screenshot of the Tableau Window Model Figure 6.3 Screenshot of Derivation and Frame Conditions Figure 7.1 The files for all the tests Figure 7.2 Speed of the prover with and without blocking /34

6 Chapter 1 Introduction 1.1 Aims and Objectives In logic, a software that is used in order to discover if a logical formula can be true (is satisfiable) is known as a Theorem Prover. This project aims to develop a Tableau Based Theorem Prover that can be used to prove any formula that contain modal and multi-modal operators. The final artefact is an extension of an already existing Tableau Based Theorem Prover. The basic prover already works for the logical formulae that use modal logic operators. The features that were expected to be added to the prover are the following: in addition to the already existing modal operators, multi-modal operators must be available the relations must be allowed to have frame conditions so that more relations can be created based on proprieties of already existing ones blocking must be introduced into the system to ensure that the prover returns a result The base prover is one developed by Hanah Anderson, a former student at the University of Manchester, as her third year project. [2] was used mainly for understanding the program, however, it was also used as a source of background reading to better understand how all the operators work. Blocking is achieved using the congruence closure system described in [1]. The overall strategy for blocking is unrestricted blocking. The first step towards achieving unrestricting blocking is the implementation of the much simpler parent blocking. This report covers the theory behind the features that must be added to the prover, the implementation of those features and the changes that had to be made in order for the system to work. Some information on what the best and worst parts of what the starting prover does is also provided. 6/34

7 1.2 Summary of chapters There are eight chapters to this report. Their contents are as follows: Chapter 2: Background This chapter explains the theory behind modal logic and blocking. It contains information about modal and multi-modal operators and how they differ to each other, why blocking is needed and how it is achieved. Chapter 3: Requirements analysis This chapter presents the original prover in detail. It covers how it works, the tools used as well as its limitations. This chapters also covers what changes needed to be made to the original prover. Chapter 4: Design This chapter covers the design aspects of the prover. First the design of the original prover is covered. Afterwards, the necessary and optional changes in the design are explained. Chapter 5: Implementation This chapter covers how the changes to the original system were coded. There is an explanation on how the new features work with the overall system as well as what changes were made in the old prover. This chapter also explains the bugs encountered during the development of the prover. Chapter 6: Results This chapter present how the completed system works. Using an example, the new features are presented. This chapter also serves as a guide on how the artefact is used. Chapter 7: Testing This chapter covers the tests performed on the system. The main information is on the tests performed on the new features. There is also a comparison between the performance of the system when the new features are used to when they are not used. Chapter 8: Conclusion This chapter summarises what was achieved during this project. The extent to which every desired feature was added is described here. There is also a description on what future work can be performed on this project and in what order it is best to perform the work. 7/34

8 Chapter 2 Background 2.1 Modal Logic In logic, a statement or a collection of statements is translated into a logical formula in order to determine if the statement is true or false. A logical formula can be a single variable whose value alone determines how the statement is evaluated, or it can be a collection of variables and logical operators [3]. Figure 2.1 Example of statement translated to logical formula For simple statements, the logical operators found in propositional logic (e.g.,, ) are sufficient in order to find a formula that translates to the statement (see Figure 2.1). However, in order to translate statements that include modality (e.g. "Sometimes" it is raining), propositional logic is extended to include modal operators (see Figure 2.2). This extended propositional logic is called modal logic and its operators are all the operators of propositional logic (i.e.,,,, ) with the added and operators. Figure 2.2 Example of logical formula with operator In modal logic, the formula will be proven within a world, a state or context in which the statement applies. What makes the and operators different from the propositional logic operators is that their sub-formulas need to be proven in separate worlds, that are related to the world in which the or is in. 2.2 Multi-modal Logic Modal logic, as an extension to propositional logic, has introduces two main concepts: the formula belongs to a state, called a world or a constant; and the and operators are used to introduce sub-formulas into other worlds. Regardless of modality the two operators will be proven in the same way by the prover. 8/34

9 Figure 2.3 Rules for proving the and operators A formula or sub-formula is true, if there exists a world, related to the one in which the is being proven, such that the 's sub-formula is true in that world. When a prover has to prove a formula, it will create a new world, then it will create a relation between the world the is in and the new world, and try to prove the sub-formula of the in that new world. Figure 2.3 shows the rules for expanding and operators. A formula or sub-formula is true, if for every relation from the 's world the 's sub-formula is true in the other world of the relation (this applies even if a relation is from a world to itself). When a prover has to prove a formula, it will try to prove the sub-formula in every world that fits the condition mentioned earlier. Also, if in the 's world a must then be proven, when the 's proving creates a new world, the 's sub-formula must be proven in this new world as well (see Figure 2.3). In multi-modal logic the operators have the same function as in as in modal logic with one additional condition. In multi-modal logic there can be multiple and operators each with an identifier. In multi-modal logic, when a formula is being proven the process is still the same, but the relation will have an identifier that matches the one of the that is being proven. When a formula is being proven, the only relations that are used must also have the same identifier as the. 2.3 Blocking Because the and operators rely on relations in order to be proven true or false, computing the truth value of a long formula becomes a more difficult problem when the relations have proprieties (e.g. reflexivity, symmetry, transitivity) that create even more relations. For some formulas, the relation proprieties can cause the process of solving to never terminate due to the dependencies between relations and the and operators. Blocking is the process of stopping a prover from extending infinitely while trying to prove some modal operator. Blocking is most needed when frame conditions apply to relations, as a formula or sub-formula of the form ϕ can cause a prover to extend infinitely, if relations are created between the 's world and the 's world. Figure 2.4 is just one example in which the prover would not terminate without blocking because of the ϕ that creates a new world for the operator. 9/34

10 Figure 2.4 Example of ϕ extending infinitely because of transitivity Examples of how the congruence closure rules are used to achieve unrestricted blocking are given in [1]. With congruence closure, blocking is achieved by rewriting occurrences of new states into already existing states. This way, if a sub-formula must be proven in the new state but an old state already has proven the sub-formula, then the rewrite will stop a sub-formula from needing to be proven a second time. This stops the prover form creating an infinite amount of worlds while attempting to prove a formula. Figure 2.5 shows the rules of the congruence closure system. Figure 2.5 The Congruence Closure System In modal logic, a rewrite of one world into another is done by using a C rule. A C rule is writhen as a pair of worlds, with the first world being the one that is rewritten to the second world (e.g. CRule (W1 W0) or {t c} in Figure 2.5 ). When a C rule is applied, all the lines that contained the first world of the C rule now are rewritten with the second line instead. C rules can be used to merge any two worlds at any point, however, the proof time is much shorter if 10/34

11 the merger is attempted earlier (so sub-formulas are not proven twice when they can be proven once). Blocking has a side benefit of shortening the time it takes to prove some formulas. If a formula has two or more sub-formulas what are the same, but in different worlds, the rewrite of one world to the other allows the prover to shorten the proving time by only proving the two sub-formulas once. Figure 2.6 shows how the proving time is shortened by only proving φ only once. Figure 2.6 Example of rewrite that shortens the proving time A disadvantage of blocking is that time may be wasted if rewrites cause contradictions and must be undone. If there is the case that, for any two worlds, a sub-formula is true in one world and it's negation is true in another, then the rewrite of the one world to the other will cause a contradiction between the two sub-formulas. Figure 2.7 shows a C rule causing a contradiction because φ and φ are now in the same world. Figure 2.7 Example of rewrite causing a contradiction When a world is rewritten, it is usually rewritten to a world that was created earlier in the proof. If all rewrites are to the root world (the world in which the overall formula must be proven and which was created earliest of all), then, for long formulas, the high number of sub-formulas increases the chance of contradictions appearing. Another rewrite strategy is to rewrite a new world to the world whose formula created the new world. This blocking strategy is known as parent merging. 11/34

12 Unrestricted blocking uses the congruence closure rules in order to rewrite as many worlds as possible. If a rewrite fails, then,for the world that was originally rewritten, there will be another attempted merger to another viable world. A viable world is any world that was created earlier during the proof and to which this rewrite was not attempted before. Unrestricted blocking attempts to maximise on the advantages of blocking and have as few separate worlds as possible. 12/34

13 Chapter 3 Requirements analysis 3.1 Existing System The final prover is made from an already existing prover. The starting prover was made by Hanah Anderson, as her third year project. It has rules to prove the operators of propositional logic as well as the and operators but not multi-modal operators. The relations created by this prover serve only to identify the dependencies between the worlds (R(s, t) means that for a is in world s, that 's sub-formula is in world t). When the prover receives a formula, it first simplifies it into negation normal form (NNF). After that the prover will try to find a model for the NNF formula. The model comprises the conditions that must be satisfied for the formula to be satisfiable. Hanah Anderson's model has information on worlds that must exist, the relations between those worlds and what atomic sub-formulae must be true in each world. Figure 3.1 is a screenshot of a model as seen in the original prover. Figure 3.1 A model for the formula " a" A model is found by expanding each sub-formula according to their respective expansion rules. The expansion rules are called alpha (α) for conjunction, beta (β) for disjunction, gamma (γ) for and sigma (σ) for (see Figure 3.2). Implication and equivalence do not have expansion rules, as they are simplified in NNF. The formula and all sub-formulas are written by the prover as lines from which a tree tableau can be built. 13/34

14 Figure 3.2 The Tableau Prover's expansion rules If all sub-formulas have been expanded and no contradictions exists, the formula is satisfiable, and a model is returned to the GUI along with the derivation of the formula. If contradictions exist the prover will backtrack to a disjunction that causes the contradiction (because of its subformula's expansion) and expand that disjunction differently. If no such disjunction exists, the formula is not satisfiable and the prover will return a derivation that shows this. The derivation is a collection of the steps that were taken in order to find a model for the formula. The derivation is made of the tableau lines that were created by expanding the overall formula. The derivation contains all the information presented in the model and, if the prover reached a contradiction(s) while looking for a model, it also contains information on how the contradiction was reached. The derivation has a structure that is sufficiently detailed in order to be able to construct the tree from all the tableau lines. If the line is for a formula the structure is: "line number. [world: formula] derived from(d){ [what line number], what rule (e.g. alpha, beta, sigma)} expands to(e){[what lines number]} conflicts with(c) {[what line number]} expanded explored (if the line has been expanded)". For lines that show a relation the structure does not have a world, as relations are used to show connections between worlds and are not associated with a single world, nor does it expand to any other line or conflict with any other line (see Figure 3.3). Figure 3.3 The two types of Tableau Lines from Hanah Anderson's prover "Conflicts with" is used to show places where the formula is proven to be a contradiction. When a sub-formula contradicts another, a line is created that has the formula "FALSE" and derivation 14/34

15 rule "closure". This is used to show the two lines are cannot be true at the same time. When a "FALSE" line is created, the prover has to find a line that contains a disjunction whose expansion indirectly causes the contradiction. If such a disjunction can be expanded differently the prover will expand the disjunction in a different way, and the contradiction along with the previous expansion is not considered in the model anymore. 3.2 Extensions to the system There are three main extension that must be made to the system: users must be able to use multi-modal operators, relations must have frame conditions from which more relations can be created and blocking must be implemented to ensure that the prover terminates. Additionally, they extended prover must keep all the functionality of the original prover and must be created in a way that permits future extensions or alteration to be possible. Finally, Dr. Renate has requested that the rule for expanding the should be called delta not sigma and will be changed accordingly. The operators of the original prover are objects. For each operator object the prover has some function capable of expanding the formula or sub-formula in order to find a model. The multimodal operators must be inserted into the system in the same way in order to allow anyone who will extend the system to easily understand how this extension was implemented. The only relation creating function in the original prover is the function expanding a formula. This fact means that frame conditions cannot inserted in a way that someone building on the final artefact can understand without looking at the code for the function. However, if the function is made simple enough to understand, this extension will not be too troublesome. The biggest problem is blocking. Unlike anything else in the system, blocking relies on changing existing lines, not just creating new ones. For this to be understood there should be a clear way of showing that a line is not how it was originally created, but that it was changed at some point by blocking. 15/34

16 Chapter 4 Design 4.1 The existing design The overall artefact has four main parts. There is a GUI that takes a logical formula in the form of a string. The string is then given to a parser, where it is converted into a logical formula and returned to the GUI. The logical formula is then passed to a pre-processor, where the formula is converted into its negation normal form (NNF) equivalent. Then a tableau is made from the NNF formula in order to find if the formula is true. The result of the tableau is then shown by the GUI. Figure 4.1 The main parts of Hanah Anderson's Tableau Prover In the Main Window, the GUI has a button called "Add Formula", from which the formula can be introduce in one of three methods. The formula can be entered as text into a file and the file path given to the GUI. Alternatively, the formula can be entered into a text box. If the formula is introduced this way it will be saved into a file and the GUI will use the first method on the file path. Figure 4.4 shows the Add Formula Window. The prover was created using ANTLR, a parser generating tool that requires a context-free grammar to create a parser. All the rules have a simple design that allows for a fast. Figure 4.2 shows the context-free grammar that ANTLR used in the original prover. 16/34

17 Figure 4.2 The context free grammar for the parser The third method of obtaining a formula is constructing it from the buttons, instead of using the parser. This takes significantly longer to do for long formulas, as the user needs to click on buttons associated with each operator. Figure 4.4 shows all the buttons that are used to create a formula. Regardless of method, once the GUI has a formula it is saved in an array whose contents is outputted onto the Main Window, as seen in Figure /34

18 Figure 4.3 The Main Window of the Tableau Prover After a formula is introduced into the GUI's array, the user can either click the "Prove Selected" or the "Prove All" button. On a single formula the effect is the same. The only difference, as the name suggests, is that, from two or more formulas, "Prove Selected" will prove the conjunction of the selected sub-formulas, while "Prove All" will prove the conjunction of all sub-formulas in the GUI's formula array. Figure 4.4 The Three ways of to Add a Formula 18/34

19 Depending on whether or not the given formula is satisfiable, the output will slightly vary. If the given formula is satisfiable, the Tableau window will output "Yes" in the Satisfiable field and it will show a model for the formula. If the formula is not satisfiable, the Satisfiable field will output "No" and no model will be displayed. Figure 4.5 shows the Tableau Window for a satisfiable formula. Figure 4.5 The Tableau Window of Hanah Anderson's Prover What will be outputted regardless of whether the formula is satisfiable or not is the derivation of the formula and, if the "Print Trace" is clicked, the trace of the derivation. The trace outputs how the derivation was extended with each sub-formula extension and changed when a contradiction was reached. The original prover also has a SPASS Satisfiable section. SPASS is a separate theorem prover developed at the Max Plank Institute for Informatics. The SPASS prover was integrated in Hanah's prover in order to test if the correctness of the artefact. 4.2 Changes in the design The overall design is easy to use and does provide information in a way that can be understood by anyone that would use the prover. While alternative designs might be return the information in an easier to understand form, this design is clear enough when [2] is read. For this reason most of the design will be kept in the extension. Most of the changes in the design will be on the output as now there will be more information to present. The extended prover will not provide a way for multi-modal operators to be introduced with buttons. This is because it would take too much time to introduce such a formula this way. In 19/34

20 the report for the original parser, Hanah has mentioned that buttons were the original way of input and how troublesome they are for long formulas. Because the extended system will have new operators and will also introduce the concept of a C rule, the derivation needs to be extended to show which line is a C rule line. While, according to the congruence closure system, a C Rule is derived from an equality reasoning that two worlds are equal (orientation), implementing that would mean having an equality reasoning line whose extension creates a C rule line. This creates somewhat repetitive information in the derivation, as a C rule can only be attempted from two worlds that are assumed to be equal. To avoid this, a C rule line should be created if two worlds might be equal, thus integrating two lines into one. This line will be derived from the creation of a new world - meaning that there exists at least two worlds to merge - according to the rule of orientation and would expand to the lines it rewrote. Figure 4.6 shows a C rule line, as seen in the formula derivation. Figure 4.6 C rule line in the derivation Since the model presents the conditions for the formula to be true, if a formula is satisfiable, the model needs to be extended to show the C rules that must be applied in order to achieve the solution. This added information also serves to inform the user that some existing relations and valuation are created by the rewrite of a C rule and without certain C rules those relations/valuations would be different. The extended model can be seen in figure 4.7. Figure 4.7 An extended model that includes C rule information The other lines of the derivation need to be extended in order to show which and operators are modal and which are multi-modal as well as show which lines are being changed by the C rules. A relation line is extended with two new sections one or each world, as well as an identifier that for the use of the multi-modal operators. A formula line is extended with one section to show which C rules apply to the line, if any. The multi-modal and operators are called mdia and mbox in order to distinguish themselves from the modal and. 20/34

21 Figure 4.8 The extended derivation lines The parser of the system does not need changes since it works just fine. The only changes to the parser are the multi-modal and operators. They will be parsed in the same way as their modal counterparts. The modal and also required identifiers but they were not used. The multi-modal operators will make use of these incorporated identifiers. The only addition to the parser will be a simple function that reads from a file a list identifiers and frame conditions and creates a map of identifiers to frame conditions for the prover to use. The SPASS prover would require some updating to understand the new and operators. The amount of time to implement everything will now allow for the update of the SPASS prover. As a result the "SPASS Satisfiable" section will be remove so it does not give false results. The extra space will be used on a section to show all the identifiers and the frame conditions they are associated with. This will be a text box that reads from a file that the parser uses as an identifier to propriety map. The format for the mapping will be simple and easy to understand. Figure 4.9 The redesigned Tableau Window 21/34

22 Chapter 5 Implementation 5.1 Multi-modal Operators The multi-modal and operators are proven nearly the same as the normal and with the simple exception that multi-modal operators create and use relations that have identifiers. The parser has to be able to accept both modal and multi-modal operators, therefore, there has to be some difference between the two in the code. For this reason the modal and and the multi-modal ones are treated as different objects, with the multi-modal and having an identifier variable added. Relations are also extended to have an identifier that is meaningless to the modal and, but is very important to the multi-modal and. If the is a modal one, the identifier will have a default value and if the is a multi-modal one, its identifier will also be the identifier of the relation. Figure 5.1 Modal and multi-modal being expanded Like the expansions for modal and multi-modal, the multi-modal will also be expanded mostly the same as the modal. The difference in the case of the operator is that, when the expansion function will look for relations that the modal, the multi-modal will have the added condition that it's identifier must match the identifier of the checked relation. 5.2 Frame Conditions Frame Conditions are used to increase the number of relations between worlds. The original system created one relation for every sub-formula that had to be proven. The extension needs to allow the relations that are created in order to expand operators need to be able to have frame conditions. From these frame conditions, when a new relation is created, more relations between worlds are created, due to the proprieties of the relations (e.g. transitivity). The starting prover needed a function that creates new relations based on the proprieties of existing relations. The function is called whenever a sub-formula has just been expanded. By associating the proprieties with the relation id, it will be easier to allow different identifier's to have different proprieties. All the relations that are used for the application of a property must 22/34

23 have the same identifier and the id must be associated with the property (e.g. The identifier "trans" is used by relations that are transitive). Furthermore, when a new relation is created from frame conditions, the new relation will have the identifier of the relations used to create the new one. The frame conditions function has code for implementing two all the known relation proprieties. The function will only create new relations if the existing ones that are used are transitive and/or Euclidean. The reason for this was that the frame conditions served mainly as a way to test if the existing system could be extended to have relation proprieties and to cause the prover to not terminate so blocking can be tested fully. Figure 5.2 shows the rules for the implemented frame conditions. Figure 5.2 Transitive and Euclidean relations In order to test if the system could cope with having frame conditions for relations, one propriety had to be implemented that would create relations between worlds not directly related otherwise. Euclidean relations are between worlds that otherwise would not be related to each other directly, unlike reflexivity and symmetry. This meant that the working implementation of Euclidean relations would offer some assurance that the other proprieties could be implemented. As the main goal of the project was to create a prover will terminate through the use of blocking, the frame conditions had the purpose of creating a situation in which the prove would not terminate so blocking can be fully tested. One of the simplest example of a formula that may not terminate requires transitivity. Because of this fact transitivity had to be implemented before blocking could be implemented and tested. While the frame conditions function may be called whenever any sub-formula is expanded, and hence a new relation is created, in the case of the modal, there are no frame conditions associated with the default identifier. It is for this reason that the function is only called if a multi-modal is expanded. The function is called right before the sub-formulas of past expanded operators are applied This allows the prover to find if the formula is satisfiable much faster, all while allowing the user to still use one multi-modal instead of the modal one, if he/she desires frame conditions. 5.3 Blocking The congruence closure system will be used to create C rules. The C rules will rewrite the worlds that are being created by any sub-formula expansions. This is done in order to stop 23/34

24 any sub-formula from creating an infinite amount of 's that will prevent the prover form reaching a solution. The C rule will be a pair object that contains two worlds as mentioned in the theory. The tableau will also have a C rule line that is used to show when a rewrite occurs. The prover will have a function that is used whenever a C rule must be expanded. When a C Rule is expanded, the function will mark all the tableau lines that contained the first world of the C rule as inactive. For all lines made inactive by the function, a new line is created that contains the sub-formula of the inactive line, but with the second world of the C rule instead. If the new line has the same world and sub-formula as an already existing line that is being expanded, then expanding the already existing line is sufficient to prove the new line. When the prover encounters an inactive line, it simply ignores it instead of expanding it. This is how infinite expansion is blocked. The blocking function does not use all of the congruence closure rules as they are given in order to provide a simpler model. The Deletion, Orientation and Extension rules are all integrated into the Simplification rule due to the fact that they will usually be used together. Additionally the Deduction, Composition and Compression rules are not used due to the fact that a simple check can ensure that their premises are never reached. Figure 5.3 The Orientation, Deletion, Extension and Simplification rules Where the Composition rule would be used if a C rule attempts a rewrite to a world that has already been rewritten, the system checks if a world has been rewritten before creating a C rule to that world and if yes, a C rule is created to the whatever the world is now called. Similarly, the rewrite of a world is only attempted if the world was just created or the C rule for it was just backtracked from, thus preventing the premise for using the Deduction rule. Finally the Compression rule is not used because the system keeps information on C rules to present in the final model ({c d} means replace all occurrences of world "c" with "d" and have no C rule). 24/34

25 Figure 5.4 The Deduction, Compression and Composition rules Since congruence closure does not dictate which worlds to be merged, this is decided when the C rule is created for a C rule line. For the blocking strategy the system will attempt to do parent merging. I have chosen parent merging instead of root merging because this makes it less likely to cause contradictions. The C rule used to achieve parent merging is created as part of the multi-modal expansion rule as soon as the frame conditions have been used to create all the relations. It is not a part of the modal expansion rule because the modal does not expand frame conditions and hence cannot stop the prover from terminating. 5.4 Backtracking Because with blocking there exists a choice as to which worlds to be merged, and some mergers cause contradictions, when a contradiction appears that can be traced back to a merge, the system can backtrack to the point when the C rule for that merge was created and undo every change that C rule has done. Finding the C rule that caused a contradiction is a simple problem. When a line that offers choices in how to expand it is being expanded (i.e. a disjunction or a C rule), the line number is stored in an array. When a contradiction appears, the system goes through all the lines that offer choices and checks If any of those lines are involved into the contradiction, everything created by expanding that decision line is being reversed and re-expanded in a different way. The C rule has a function for expanding it and a function for reversing what the expansion did. After that, because of unrestricted blocking, the system will try to find if there are any other worlds to which a C rule can be made for the world that could not be rewritten. Unlike the initial merger, which is attempted with the parent, the following rewrite attempts are with any world that was created before the world that is being rewritten, regardless of any relation. If another contradiction is caused by the new C rule, the system backtracks again and rewrites until no contradiction appears or there are no C rules to be created. 25/34

26 5.5 Code changes and Bug Fixes The starting prover was coded to cover modal logic. Because of this certain assumptions were made in the implementation that were not wrong for the original prover but that cause bugs in the extension of the code. For the system to work with the new extensions some changes had to be made to the starting prover in order to keep most of the functionality and only change what was causing the bugs. The original prover worked under the assumption that a relation is a way of showing the creation of a new world. If a world was the second element in a relation, than that world was just created. Under this assumption, when the system would backtrack and delete a relation, it would also delete the second world in that relation from the worlds array. Since the extended system allows for a world to be the second element in more than one relation, this assumption no longer applies. As a result, when a relation is removed as part of backtracking, the world is not removed unless there are no relations that contain that world. Another assumption made when developing the original prover was that it will only make decisions when expanding a disjunction. This does not apply to the extended system because a C rule offers the decision of assuming two worlds are equal. When backtracking, the original system did not check if the decision point to backtrack to was a disjunction or not. While this was not mistake in the original system, the extended system requires such a check in order to know what the alternative decision is. Outside of the bugs caused by assumptions there was one final bug that had to be fixed for the parser. In the original parser, the conversion to negation normal form was being made wrong. When the negation of a conjunction or disjunction had to be simplified, the prover would convert the conjunction to disjunction and vice versa, but would not change the sub-formulas of that conjunction/disjunction to their negation. This meant that every time a negated conjunction/disjunction had to be simplified, the prover would receive the wrong NNF formula. 26/34

27 Chapter 6 Results This chapter will present the extended system in action by providing an example of how the parser finds a model for a multi-modal formula. The formula will be one that would cause the prover to never terminate without blocking. The formula will be ( a) ( a) with the identifier being the same for all operators. For this formula if the multi-modal and use an identifier that is mapped to transitivity, if no blocking was implemented, the would create a new a sub-formula in every world and the a subformula would create a new world for the to use. This would cause the non blocking parser to never terminate. 6.1 Input The extended parser has two ways of imputing a multi-modal formula: as a text by using "Parse Text" and as a file by using "Parse File". Both methods work exactly as they did in the original prover, with the addition that the parser they use can now understand the multi-modal operators. Figure 6.1 shows a screenshot of the two ways a multi-modal formula can be parsed. Figure 6.1 Screenshots of the two ways to parse a formula 27/34

28 6.2 Output Once "Prove All" or "Prove Selected" has been clicked the prover will create the derivation of the given formula. Once the derivation is complete the Tableau Window appears and shows if the formula is satisfiable or not. Since this formula is satisfiable, it will also show a model for it, as seen in Figure 6.2. Figure 6.2 Screenshot of the Tableau Window Model By scrolling on the horizontal side bar the user can also see the final derivation of the formula as well as a list of identifiers and the frame conditions they are associated with (see Figure 6.3). Figure 6.3 Screenshot of Derivation and Frame Conditions 28/34

29 Chapter 7 Testing Testing was performed on both the new functions of the extended prover and on the old ones. The old functionality was tested using the test files provided by Hanah Anderson along with her prover. Performance tests were also executed to check if the added functionality makes the prover slower or faster. 7.1 Unit testing Unit testing was performed on all the classes that have received extended functionality. It served as the main method of testing every extension made until the functions could work together to allow prover testing. Unit testing was also performed on the old system using the already existing test files to ensure that the old prover was not having any parts reach error due to the new functions. Figure 7.1 shows all the test files that were created to test the resulting prover, most of the files being used for unit testing. Figure 7.1 The files for all the tests Unit tests were designed as soon as the design for each extension was vaguely planed. This was done to ensure that each function was being implemented to pass the tests and not vice versa. The unit tests for the SPASS prover were ignored as SPASS is not used in the resulting artefact. 7.2 Blocking testing Blocking had to be tested several times during its development. First was the testing of the parent blocking. The goal was to determine if the prover would now reach termination for all formulas and that the solution was correct. Afterwards, the backtracking from a C rule that caused a contradictions was tested. The goal was to test if upon backtrack, the prover would evaluate each sub-formula in the world it is supposed to. Finally, unrestricted blocking was 29/34

30 tested to determine if the prover is capable of merging worlds that are not directly related to each other. Table 7.1 shows what the structure of the formula was, what were the expected result computed on paper and the output of the prover. The expected outcome consists of valuations and active and failed C rules if formula is satisfiable, output must be "No" otherwise. Test No. What was the test Expected outcome Actual outcome 1 Formula with no contradictions All valuations are in the root world and for As expected that expands infinitely every diamond there is a C rule active 2 Formula with contradictions if root and child world are merged One valuation made in root and another made in child world and a failed C rule for merging child and root world As expected 3 Formula with contradictions if root and any other world are merged that expands infinitely 4 Formula where no child world can be merged with the root but child worlds do not contradict each other if merged 5 Unsatisfiable formula because of a contradiction between a box ad a diamond 6 Disjunction between test 5 and another version of test 2 7 Formula with contradictions if root and certain other worlds are merged that expands infinitely One valuation made in root and another made in child world, C rule for root failed and one C rule active to ensure blocking Some valuations are in root and all child worlds are merged together along with their valuations Output is "No" Prover expands test 2 Merge occurs between any child and its parent if they do not have contradicting valuations. Valuations exist in all worlds that are not merged with their parent as well as in root Table 7.1 Tests performed on all features of blocking 7.3 Prover testing The validity of the extended prover was tested on a file with 102 labelled formulas. Out of the 102 formulas: 96 were labelled "satisfiable" without frame conditions, 2 were labelled "unsatisfiable" and 4 were labelled "unknown". For all formulas labelled "satisfiable" and "unsatisfiable" the prover returned the result matching the label. For the formulas labelled as "unknown" the prover did not reach a conclusion in a reasonable amount of time and was thus terminated. For each formula, the time it took for the prover to reach a conclusion with blocking was compared against the time it took without blocking. Figure 7.2 shows the amount of time each As expected As expected As expected As expected As expected 30/34

31 method of proving has taken. Figure 7.2 does not show all the data as there were two formulas for which the time was above 200 milliseconds. For those formulas the prover has shown to be faster with blocking. These formulas were excluded as the figure would show all the values from 0 to 10 milliseconds on the same line Milliseconds 30 Without Blocking With Blocking Formula No. Figure 7.2 Speed of the prover with and without blocking 31/34

32 Chapter 8 Conclusion 8.1 Reflection on the achievements The goal of this project was to create a working Tableau Based Theorem Prover that incorporates multi-modal operators, frame conditions and blocking. The most desired feature to be implemented was blocking. Blocking was implemented and all its features were fully tested. Multi-modal operators have also been implemented exactly as required and allow the user request a proof both with and without frame conditions by keeping intact the modal and. However, due to time constraints, relations only have two frame conditions implemented. Frame conditions were needed in order to show why blocking is needed and for this purpose the goal was achieved. However, with the other frame conditions implemented the prover would be able to test prove a higher number of formulas. The difficulty in implementing blocking is what limited the number of frame conditions implemented, as there was simply not enough time to implement and test any more frame conditions after blocking was fully tested. On a personal level, I have gained a deeper understanding of how modal logic works, as well as an understanding on how multi-modal logic and blocking work. I also gained experience into how difficult it is to expand someone else's code and use new tools without some introduction to them. I believe this experience has made be grow as a programmer and I am now better equipped to work in industry. 8.2 Future work While the prover is now capable of doing everything that was desired of it at the start of the project, there is still more work that can be done to improve the end product. The extension of the prover was difficult due to insufficient documentation. Not all frame conditions were implemented. And the user interface is only usable by someone that has an understanding about both modal logic and how the prover works. The code for the prover is not very well distributed, as there are some classes with less than fifty lines of code and other classes with over one thousand lines of code. This makes any extensions on the prover very difficult as too much time would be required for code understanding. The code must be restructured and better commented to allow a faster understanding if any other extension is to be made possible. I have made an effort to code my extensions in order to make it easier to understand, but that might not be enough. 32/34

33 The function for implementing frame conditions is easy to understand without needing a deep understanding of the whole system. This and the fact that there are already two frame conditions implemented to serve as examples means that the rest of the frame conditions can be implemented and tested with few difficulties. The user interface is not intuitive and there are no buttons for using multi-modal operators. The button system should either be extended to include the buttons or simplified to only allow the user to use the parser to give a formula. This is something Hanah Anderson has also mentioned in [2]. Some examples into how each operator is called might also be useful (e.g. let user know that "dia" means modal " "). Lastly the output can be more detailed than just a derivation and a model. Figure 2.4 and Figure 2.5 seem more intuitive and allow for an easier understanding of how worlds formulas and relations work together. 33/34

34 References [1] Schmidt, R.A. and Waldmann, U.(2014) 'Tableau with Congruence Closure Notes The Paper', University of Manchester [2] Anderson, H.(2012), 'Tableau Prover with Dynamic Backtracking', University of Manchester [Online] Available at: (Accessed: 27 April 2015) [3] Voronkov, A. (2014), 'Logic and modelling', University of Manchester [Online] Available at: (Accessed: 24 November 2014) [4] Herzig, A.(2008), 'The basic multimodal logic K', [Online] Available at: t=8&ved=0cgqqfjah&url=http%3a%2f%2fwww.irit.fr%2f~andreas.herzig%2fcmodal Logic%2FCh2MultimodalK.pdf&ei=g7E-VevEN5D3aovTgPgE&usg=AFQjCNGOJFbdAsLfUOXt_FH9pC0qs1ZmQ&bvm=bv ,d.d2s (Accessed: 22 November 2014) 34/34

Binary Decision Diagrams

Binary Decision Diagrams Logic and roof Hilary 2016 James Worrell Binary Decision Diagrams A propositional formula is determined up to logical equivalence by its truth table. If the formula has n variables then its truth table

More information

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

STABILITY AND PARADOX IN ALGORITHMIC LOGIC STABILITY AND PARADOX IN ALGORITHMIC LOGIC WAYNE AITKEN, JEFFREY A. BARRETT Abstract. Algorithmic logic is the logic of basic statements concerning algorithms and the algorithmic rules of deduction between

More information

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989

P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989 University of Pennsylvania ScholarlyCommons Technical Reports (CIS) Department of Computer & Information Science October 1989 P Is Not Equal to NP Jon Freeman University of Pennsylvania Follow this and

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 37 Resolution Rules If some literals can be unified, the same algorithm should be able

More information

A proof-producing CSP solver: A proof supplement

A proof-producing CSP solver: A proof supplement A proof-producing CSP solver: A proof supplement Report IE/IS-2010-02 Michael Veksler Ofer Strichman mveksler@tx.technion.ac.il ofers@ie.technion.ac.il Technion Institute of Technology April 12, 2010 Abstract

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 3. Set Theory. 3.1 What is a Set? Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any

More information

(Refer Slide Time 6:48)

(Refer Slide Time 6:48) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 8 Karnaugh Map Minimization using Maxterms We have been taking about

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

PROPOSITIONAL LOGIC (2)

PROPOSITIONAL LOGIC (2) PROPOSITIONAL LOGIC (2) based on Huth & Ruan Logic in Computer Science: Modelling and Reasoning about Systems Cambridge University Press, 2004 Russell & Norvig Artificial Intelligence: A Modern Approach

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

Joint Entity Resolution

Joint Entity Resolution Joint Entity Resolution Steven Euijong Whang, Hector Garcia-Molina Computer Science Department, Stanford University 353 Serra Mall, Stanford, CA 94305, USA {swhang, hector}@cs.stanford.edu No Institute

More information

6c Lecture 3 & 4: April 8 & 10, 2014

6c Lecture 3 & 4: April 8 & 10, 2014 6c Lecture 3 & 4: April 8 & 10, 2014 3.1 Graphs and trees We begin by recalling some basic definitions from graph theory. Definition 3.1. A (undirected, simple) graph consists of a set of vertices V and

More information

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 11 Coding Strategies and Introduction to Huffman Coding The Fundamental

More information

4.1 Review - the DPLL procedure

4.1 Review - the DPLL procedure Applied Logic Lecture 4: Efficient SAT solving CS 4860 Spring 2009 Thursday, January 29, 2009 The main purpose of these notes is to help me organize the material that I used to teach today s lecture. They

More information

Chapter IV. Introduction

Chapter IV. Introduction 54 Chapter IV ULTRAMAN ARCHITECTURE Introduction In previous chapters, we have introduced and motivated the ideas of a transformational approach to generating user interfaces. Throughout this dissertation

More information

CSC 501 Semantics of Programming Languages

CSC 501 Semantics of Programming Languages CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 9 Normal Forms In the last class we have seen some consequences and some equivalences,

More information

== is a decent equivalence

== is a decent equivalence Table of standard equiences 30/57 372 TABLES FOR PART I Propositional Logic Lecture 2 (Chapter 7) September 9, 2016 Equiences for connectives Commutativity: Associativity: P Q == Q P, (P Q) R == P (Q R),

More information

Resolution (14A) Young W. Lim 6/14/14

Resolution (14A) Young W. Lim 6/14/14 Copyright (c) 2013-2014. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free

More information

Formally-Proven Kosaraju s algorithm

Formally-Proven Kosaraju s algorithm Formally-Proven Kosaraju s algorithm Laurent Théry Laurent.Thery@sophia.inria.fr Abstract This notes explains how the Kosaraju s algorithm that computes the strong-connected components of a directed graph

More information

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5 [talking head] Formal Methods of Software Engineering means the use of mathematics as an aid to writing programs. Before we can

More information

Chapter 3: Propositional Languages

Chapter 3: Propositional Languages Chapter 3: Propositional Languages We define here a general notion of a propositional language. We show how to obtain, as specific cases, various languages for propositional classical logic and some non-classical

More information

The Resolution Algorithm

The Resolution Algorithm The Resolution Algorithm Introduction In this lecture we introduce the Resolution algorithm for solving instances of the NP-complete CNF- SAT decision problem. Although the algorithm does not run in polynomial

More information

Context-free Grammars

Context-free Grammars 1 contents of Context-free Grammars Phrase Structure Everyday Grammars for Programming Language Formal Definition of Context-free Grammars Definition of Language Left-to-right Application cfg ects Transforming

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No.

Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. Database Management System Prof. D. Janakiram Department of Computer Science & Engineering Indian Institute of Technology, Madras Lecture No. # 20 Concurrency Control Part -1 Foundations for concurrency

More information

Universiteit Leiden Computer Science

Universiteit Leiden Computer Science Universiteit Leiden Computer Science Optimizing octree updates for visibility determination on dynamic scenes Name: Hans Wortel Student-no: 0607940 Date: 28/07/2011 1st supervisor: Dr. Michael Lew 2nd

More information

CSE 331: Introduction to Algorithm Analysis and Design Graphs

CSE 331: Introduction to Algorithm Analysis and Design Graphs CSE 331: Introduction to Algorithm Analysis and Design Graphs 1 Graph Definitions Graph: A graph consists of a set of verticies V and a set of edges E such that: G = (V, E) V = {v 0, v 1,..., v n 1 } E

More information

Disjoint Sets and the Union/Find Problem

Disjoint Sets and the Union/Find Problem Disjoint Sets and the Union/Find Problem Equivalence Relations A binary relation R on a set S is a subset of the Cartesian product S S. If (a, b) R we write arb and say a relates to b. Relations can have

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 11 Ana Bove April 26th 2018 Recap: Regular Languages Decision properties of RL: Is it empty? Does it contain this word? Contains

More information

6. Finding Efficient Compressions; Huffman and Hu-Tucker

6. Finding Efficient Compressions; Huffman and Hu-Tucker 6. Finding Efficient Compressions; Huffman and Hu-Tucker We now address the question: how do we find a code that uses the frequency information about k length patterns efficiently to shorten our message?

More information

Workbook Unit 13: Natural Deduction Proofs (IV)

Workbook Unit 13: Natural Deduction Proofs (IV) Workbook Unit 13: Natural Deduction Proofs (IV) Overview 1 1. The Biconditional Introduction Rule ( Int) 2 2. The Disjunction Elimination Rule ( Elim) 7 3. Reductio ad absurdum arguments: ~Int and ~Elim

More information

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

Propositional Logic. Andreas Klappenecker

Propositional Logic. Andreas Klappenecker Propositional Logic Andreas Klappenecker Propositions A proposition is a declarative sentence that is either true or false (but not both). Examples: College Station is the capital of the USA. There are

More information

An Evolution of Mathematical Tools

An Evolution of Mathematical Tools An Evolution of Mathematical Tools From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world.

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.

We show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C. 219 Lemma J For all languages A, B, C the following hold i. A m A, (reflexive) ii. if A m B and B m C, then A m C, (transitive) iii. if A m B and B is Turing-recognizable, then so is A, and iv. if A m

More information

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses

1.4 Normal Forms. We define conjunctions of formulas as follows: and analogously disjunctions: Literals and Clauses 1.4 Normal Forms We define conjunctions of formulas as follows: 0 i=1 F i =. 1 i=1 F i = F 1. n+1 i=1 F i = n i=1 F i F n+1. and analogously disjunctions: 0 i=1 F i =. 1 i=1 F i = F 1. n+1 i=1 F i = n

More information

Software Engineering Lecture Notes

Software Engineering Lecture Notes Software Engineering Lecture Notes Paul C. Attie August 30, 2013 c Paul C. Attie. All rights reserved. 2 Contents I Hoare Logic 11 1 Propositional Logic 13 1.1 Introduction and Overview..............................

More information

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214 Theorem proving PVS theorem prover Abhik Roychoudhury National University of Singapore Both specification and implementation can be formalized in a suitable logic. Proof rules for proving statements in

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

3.7 Denotational Semantics

3.7 Denotational Semantics 3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These

More information

Linear Time Unit Propagation, Horn-SAT and 2-SAT

Linear Time Unit Propagation, Horn-SAT and 2-SAT Notes on Satisfiability-Based Problem Solving Linear Time Unit Propagation, Horn-SAT and 2-SAT David Mitchell mitchell@cs.sfu.ca September 25, 2013 This is a preliminary draft of these notes. Please do

More information

Some Hardness Proofs

Some Hardness Proofs Some Hardness Proofs Magnus Lie Hetland January 2011 This is a very brief overview of some well-known hard (NP Hard and NP complete) problems, and the main ideas behind their hardness proofs. The document

More information

Stating the obvious, people and computers do not speak the same language.

Stating the obvious, people and computers do not speak the same language. 3.4 SYSTEM SOFTWARE 3.4.3 TRANSLATION SOFTWARE INTRODUCTION Stating the obvious, people and computers do not speak the same language. People have to write programs in order to instruct a computer what

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

PCP and Hardness of Approximation

PCP and Hardness of Approximation PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

Principles of Algorithm Design

Principles of Algorithm Design Principles of Algorithm Design When you are trying to design an algorithm or a data structure, it s often hard to see how to accomplish the task. The following techniques can often be useful: 1. Experiment

More information

Operational Semantics

Operational Semantics 15-819K: Logic Programming Lecture 4 Operational Semantics Frank Pfenning September 7, 2006 In this lecture we begin in the quest to formally capture the operational semantics in order to prove properties

More information

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3

Midterm 1 Solutions. (i) False. One possible counterexample is the following: n n 3 CS 170 Efficient Algorithms & Intractable Problems, Spring 2006 Midterm 1 Solutions Note: These solutions are not necessarily model answers. Rather, they are designed to be tutorial in nature, and sometimes

More information

Solutions and grading standards

Solutions and grading standards Exam information 77 students took the exam. Scores ranged from 6 to 30, with a median of 23 and an average of 22.2. There were 42 scores between 23 and 30, 22 between 16 and 22, and 10 between 6 and 15.

More information

Exact Algorithms Lecture 7: FPT Hardness and the ETH

Exact Algorithms Lecture 7: FPT Hardness and the ETH Exact Algorithms Lecture 7: FPT Hardness and the ETH February 12, 2016 Lecturer: Michael Lampis 1 Reminder: FPT algorithms Definition 1. A parameterized problem is a function from (χ, k) {0, 1} N to {0,

More information

CS40-S13: Functional Completeness

CS40-S13: Functional Completeness CS40-S13: Functional Completeness Victor Amelkin victor@cs.ucsb.edu April 12, 2013 In class, we have briefly discussed what functional completeness means and how to prove that a certain system (a set)

More information

Disjoint Sets. The obvious data structure for disjoint sets looks like this.

Disjoint Sets. The obvious data structure for disjoint sets looks like this. CS61B Summer 2006 Instructor: Erin Korber Lecture 30: 15 Aug. Disjoint Sets Given a set of elements, it is often useful to break them up or partition them into a number of separate, nonoverlapping groups.

More information

COMP 410 Lecture 1. Kyle Dewey

COMP 410 Lecture 1. Kyle Dewey COMP 410 Lecture 1 Kyle Dewey About Me I research automated testing techniques and their intersection with CS education My dissertation used logic programming extensively This is my second semester at

More information

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true.

for all x, the assertion P(x) is false. there exists x, for which the assertion P(x) is true. You can t prove a predicate is true because a predicate is not an assertion, you can t prove it is valid as it is not a deduction! If someone asks you to prove P(x), it is not totally clear what they mean.

More information

MITOCW watch?v=w_-sx4vr53m

MITOCW watch?v=w_-sx4vr53m MITOCW watch?v=w_-sx4vr53m The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To

More information

Lexical and Syntax Analysis. Bottom-Up Parsing

Lexical and Syntax Analysis. Bottom-Up Parsing Lexical and Syntax Analysis Bottom-Up Parsing Parsing There are two ways to construct derivation of a grammar. Top-Down: begin with start symbol; repeatedly replace an instance of a production s LHS with

More information

1 Leaffix Scan, Rootfix Scan, Tree Size, and Depth

1 Leaffix Scan, Rootfix Scan, Tree Size, and Depth Lecture 17 Graph Contraction I: Tree Contraction Parallel and Sequential Data Structures and Algorithms, 15-210 (Spring 2012) Lectured by Kanat Tangwongsan March 20, 2012 In this lecture, we will explore

More information

Linear Clause Generation by Tableaux and DAGs

Linear Clause Generation by Tableaux and DAGs kovasznai 2007/8/10 11:27 page 109 #1 5/1 (2007), 109 118 tmcs@inf.unideb.hu http://tmcs.math.klte.hu Linear Clause Generation by Tableaux and DAGs Gergely Kovásznai Abstract. Clause generation is a preliminary

More information

Combinatorial Optimization

Combinatorial Optimization Combinatorial Optimization Problem set 7: solutions. Formulate and solve an integer program for the following scenario. A trader of unusual objects is traveling with a caravan that begins in city A, proceeds

More information

CSCI 403: Databases 13 - Functional Dependencies and Normalization

CSCI 403: Databases 13 - Functional Dependencies and Normalization CSCI 403: Databases 13 - Functional Dependencies and Normalization Introduction The point of this lecture material is to discuss some objective measures of the goodness of a database schema. The method

More information

CS103 Spring 2018 Mathematical Vocabulary

CS103 Spring 2018 Mathematical Vocabulary CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming

More information

(Refer Slide Time: 05:25)

(Refer Slide Time: 05:25) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering IIT Delhi Lecture 30 Applications of DFS in Directed Graphs Today we are going to look at more applications

More information

Algorithm 23 works. Instead of a spanning tree, one can use routing.

Algorithm 23 works. Instead of a spanning tree, one can use routing. Chapter 5 Shared Objects 5.1 Introduction Assume that there is a common resource (e.g. a common variable or data structure), which different nodes in a network need to access from time to time. If the

More information

Algebraic Processors

Algebraic Processors Algebraic Processors Algebraic Processors By Pouya Larjani, B.Sc. A Thesis Submitted to the School of Graduate Studies in partial fulfilment of the requirements for the degree of Master of Science Department

More information

Finding Strongly Connected Components

Finding Strongly Connected Components Yufei Tao ITEE University of Queensland We just can t get enough of the beautiful algorithm of DFS! In this lecture, we will use it to solve a problem finding strongly connected components that seems to

More information

Lecture 5. Logic I. Statement Logic

Lecture 5. Logic I. Statement Logic Ling 726: Mathematical Linguistics, Logic. Statement Logic V. Borschev and B. Partee, September 27, 2 p. Lecture 5. Logic I. Statement Logic. Statement Logic...... Goals..... Syntax of Statement Logic....2.

More information

SAT-CNF Is N P-complete

SAT-CNF Is N P-complete SAT-CNF Is N P-complete Rod Howell Kansas State University November 9, 2000 The purpose of this paper is to give a detailed presentation of an N P- completeness proof using the definition of N P given

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 16 Cutting Plane Algorithm We shall continue the discussion on integer programming,

More information

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1 CS 70 Discrete Mathematics for CS Fall 2000 Wagner MT1 Sol Solutions to Midterm 1 1. (16 pts.) Theorems and proofs (a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are

More information

Principles of AI Planning. Principles of AI Planning. 7.1 How to obtain a heuristic. 7.2 Relaxed planning tasks. 7.1 How to obtain a heuristic

Principles of AI Planning. Principles of AI Planning. 7.1 How to obtain a heuristic. 7.2 Relaxed planning tasks. 7.1 How to obtain a heuristic Principles of AI Planning June 8th, 2010 7. Planning as search: relaxed planning tasks Principles of AI Planning 7. Planning as search: relaxed planning tasks Malte Helmert and Bernhard Nebel 7.1 How to

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore

Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore Combinatorics Prof. Dr. L. Sunil Chandran Department of Computer Science and Automation Indian Institute of Science, Bangalore Lecture - 5 Elementary concepts and basic counting principles So, welcome

More information

A computer implemented philosophy of mathematics

A computer implemented philosophy of mathematics A computer implemented philosophy of mathematics M. Randall Holmes May 14, 2018 This paper presents a philosophical view of the basic foundations of mathematics, which is implemented in actual computer

More information

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F 1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression

More information

Variants of Turing Machines

Variants of Turing Machines November 4, 2013 Robustness Robustness Robustness of a mathematical object (such as proof, definition, algorithm, method, etc.) is measured by its invariance to certain changes Robustness Robustness of

More information

A Framework for Securing Databases from Intrusion Threats

A Framework for Securing Databases from Intrusion Threats A Framework for Securing Databases from Intrusion Threats R. Prince Jeyaseelan James Department of Computer Applications, Valliammai Engineering College Affiliated to Anna University, Chennai, India Email:

More information

Logic and Computation

Logic and Computation Logic and Computation From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world. This is

More information

JASMINT: Language to User-Friendly AST with Emphasis on Transpilation. By: John Bradbury. Advisor: John Clements. Computer Science Department

JASMINT: Language to User-Friendly AST with Emphasis on Transpilation. By: John Bradbury. Advisor: John Clements. Computer Science Department JASMINT: Language to User-Friendly AST with Emphasis on Transpilation By: John Bradbury Advisor: John Clements Computer Science Department College of Engineering California Polytechnic State University,

More information

Dartmouth Computer Science Technical Report TR Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph

Dartmouth Computer Science Technical Report TR Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph Dartmouth Computer Science Technical Report TR2014-753 Chain Match: An Algorithm for Finding a Perfect Matching of a Regular Bipartite Multigraph Stefanie Ostrowski May 28, 2014 Abstract We consider the

More information

Computer Science Technical Report

Computer Science Technical Report Computer Science Technical Report Feasibility of Stepwise Addition of Multitolerance to High Atomicity Programs Ali Ebnenasir and Sandeep S. Kulkarni Michigan Technological University Computer Science

More information

Admin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return

Admin. How's the project coming? After these slides, read chapter 13 in your book. Quizzes will return Recursion CS 1 Admin How's the project coming? After these slides, read chapter 13 in your book Yes that is out of order, but we can read it stand alone Quizzes will return Tuesday Nov 29 th see calendar

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Webinar IUCLID 6 Questions and Answers

Webinar IUCLID 6 Questions and Answers IUCLID 6 Webinar IUCLID 6 Questions and Answers Advanced users (part 1) - Switching from IUCLID 5.6 to IUCLID 6 1/6/2016 Switching from IUCLID 5.6 to IUCLID 6 Q&A Page 1 Table of Contents 1. INTRODUCTION...

More information

WACC Report. Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow

WACC Report. Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow WACC Report Zeshan Amjad, Rohan Padmanabhan, Rohan Pritchard, & Edward Stow 1 The Product Our compiler passes all of the supplied test cases, and over 60 additional test cases we wrote to cover areas (mostly

More information

Clean & Speed Up Windows with AWO

Clean & Speed Up Windows with AWO Clean & Speed Up Windows with AWO C 400 / 1 Manage Windows with this Powerful Collection of System Tools Every version of Windows comes with at least a few programs for managing different aspects of your

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

Categorizing Migrations

Categorizing Migrations What to Migrate? Categorizing Migrations A version control repository contains two distinct types of data. The first type of data is the actual content of the directories and files themselves which are

More information

Lecture 5: Formation Tree and Parsing Algorithm

Lecture 5: Formation Tree and Parsing Algorithm Discrete Mathematics (II) Spring 2012 Lecture 5: Formation Tree and Parsing Algorithm Lecturer: Yi Li 1 Overview In this lecture, we completely focus on syntax of proposition. And the term proposition

More information

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Finite Model Generation for Isabelle/HOL Using a SAT Solver Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly

More information

Propositional Calculus

Propositional Calculus Propositional Calculus Proposition is a statement that is either or. Example 1 Propositions: It rains. Sun is shining and my coat is wet. If Ann plays with me, I give her a candy. x > 10 x = 1 and y

More information

Foundations of Computation

Foundations of Computation Foundations of Computation Second Edition (Version 2.3.2, Summer 2011) Carol Critchlow and David Eck Department of Mathematics and Computer Science Hobart and William Smith Colleges Geneva, New York 14456

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

(Refer Slide Time: 06:01)

(Refer Slide Time: 06:01) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 28 Applications of DFS Today we are going to be talking about

More information

CSC2108: Automated Verification Assignment 1 - Solutions

CSC2108: Automated Verification Assignment 1 - Solutions 8 CSC218: Automated Verification Assignment 1 - Solutions 1. Solve the following problem: Use the definition of between states and CTL formulas to explain why means that is true infinitely often along

More information

(Refer Slide Time: 01:25)

(Refer Slide Time: 01:25) Computer Architecture Prof. Anshul Kumar Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture - 32 Memory Hierarchy: Virtual Memory (contd.) We have discussed virtual

More information