Equational Reasoning in THEOREMA

Size: px
Start display at page:

Download "Equational Reasoning in THEOREMA"

Transcription

1 Research Institute for Symbolic Computation Johannes Kepler University of Linz, Austria Workshop on Formal Gröbner Bases Theory. March 8, Linz, Austria

2 Outline 1 2

3 Equational Prover of THEOREMA Equational Prover Method and Implementation A prover for unit equalities in the first order or applicative higher order form. Based on unfailing completion. Fully automatic (no user interaction during run time). Allows sequence variables in the input. Has access to MATHEMATICA functions. Nice input and output.

4 Simple Examples Equational Prover Method and Implementation Example (Boolean Algebra. First Order Form.) Given Boolean algebra axioms: x x + 0 = x x x + ( x) = 1 x,y x,y x + y = y + x x y = y x x,y,z x + (y z) = (x + y) (x + z) x,y,z x (y + z) = (x y) + (x z) x x 1 = x x x ( x) = 0 Prove idempotence of multiplication: x x x = x

5 Simple Examples Equational Prover Method and Implementation Example (Combinatory Logic. Higher Order Form.) Given the definitions of M and Q combinators: x,y,z x M(x) = x(x) Q(x)(y)(z) = y(x(z)) Prove existence of a fixpoint: x y y = x(y)

6 Method Equational Prover Method and Implementation Completion without failure (Bachmair, Dershowitz, Plaisted). Unfailing variant of Knuth-Bendix completion. Critical pair/completion method, related to Gröbner bases.

7 Equational Prover Method and Implementation Unfailing Completion. The Procedure Function ProveByCompletion(E, G, >) 1: (A, P):=(, E) 2: while trivial(g) P = do 3: e :=Select(P); P := P\{e} 4: if orphan(e) then 5: e :=Normalize > A (e) 6: if redundant(e) then 7: (A, P 1 ):=Interred > (A, e) 8: A := A {Orient > (e)} 9: P 2 :=CP > (e, A) 10: P := P Normalize > A (P 1 P 2 ) 11: 12: end G :=Normalize > A (G) 13: end 14: end 15: return trivial(g)

8 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

9 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

10 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

11 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

12 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

13 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

14 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

15 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

16 Organization of Passive Facts Equational Prover Method and Implementation The set P can grow very big. Challenges: 1 How to select the minimal equality fast. 2 How to store P compactly. 3 How to delete redundant equalities from P fast. Solution idea: 1 Organize P as pairing heaps. 2 Store in heaps only the information necessary to select and delete equalities. 3 Keep terms separately as stringterms and refer to them when needed.

17 Organization of Passive Facts Equational Prover Method and Implementation Each equality carries the following information: Unique number assigned to it at the moment when the equality is generated: an ID. Example Weight (number of symbols in the sides of equality). ID of the First parent. ID of the Second parent. Assume f (x, f (a, x)) = a is the 123rd equality generated by the procedure as a critical pair of equalities 115 and 7. Then the tuple attached to this equality is 123, 6, 115, 7.

18 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) P is organized in paired heaps, two-layers: Lower layer: Collection of heaps, e.g. 3,7,8,10. The heap 3 contains (the encoding of) all critical pairs whose first parent is 3. Each lower heap: ordered by the given priority, e.g. weight, with minimal element in the top (small red triangle).

19 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) P is organized in paired heaps, two-layers: Lower layer: Collection of heaps, e.g. 3,7,8,10. The heap 3 contains (the encoding of) all critical pairs whose first parent is 3. Each lower heap: ordered by the given priority, e.g. weight, with minimal element in the top (small red triangle).

20 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) P is organized in paired heaps, two-layers: Lower layer: Collection of heaps, e.g. 3,7,8,10. The heap 3 contains (the encoding of) all critical pairs whose first parent is 3. Each lower heap: ordered by the given priority, e.g. weight, with minimal element in the top (small red triangle).

21 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) P is organized in paired heaps, two-layers: Lower layer: Collection of heaps, e.g. 3,7,8,10. The heap 3 contains (the encoding of) all critical pairs whose first parent is 3. Each lower heap: ordered by the given priority, e.g. weight, with minimal element in the top (small red triangle).

22 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

23 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

24 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

25 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

26 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

27 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

28 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

29 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) Upper heap consists of all top elements of lower heaps. Upper heap is ordered in the same way as the lowers. Select takes the topmost element of the upper heap. Assume its first parent was 7. Then: This element is removed also from the top of the heap 7. Heap 7 is rearranged. New minimal element on the top. The new minimal element of the heap 7 comes to the upper heap that is rearranged. No other heap is touched.

30 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) When an active equality from A gets reduced by Interred: Entire heap whose first parent was the reduced equality is deleted at once. (e.g. heap 8) Upper heap is rearranged. Other lower heaps might contain elements whose second parent was the reduced equality. They remain in the heaps and get removed by the orphan test after selection.

31 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) When an active equality from A gets reduced by Interred: Entire heap whose first parent was the reduced equality is deleted at once. (e.g. heap 8) Upper heap is rearranged. Other lower heaps might contain elements whose second parent was the reduced equality. They remain in the heaps and get removed by the orphan test after selection.

32 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) When an active equality from A gets reduced by Interred: Entire heap whose first parent was the reduced equality is deleted at once. (e.g. heap 8) Upper heap is rearranged. Other lower heaps might contain elements whose second parent was the reduced equality. They remain in the heaps and get removed by the orphan test after selection.

33 Equational Prover Method and Implementation Organization of Passive Facts (Cont.) When an active equality from A gets reduced by Interred: Entire heap whose first parent was the reduced equality is deleted at once. (e.g. heap 8) Upper heap is rearranged. Other lower heaps might contain elements whose second parent was the reduced equality. They remain in the heaps and get removed by the orphan test after selection.

34 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

35 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

36 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

37 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

38 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

39 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

40 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

41 Normalization Equational Prover Method and Implementation Programming language of Mathematica is a rewrite rule language. Idea: use Mathematica assignment rules for rewriting. Rewrite rules are transformed into Mathematica assignments. Equalities are transformed into Mathematica conditional assignments. Advantages: Probably the fastest way of doing rewriting in Mathematica. No need of implementing special data structures for rewriting. Disadvantages: Minimal control on rewriting strategies. Can not keep track of results of single rewrite steps. Additional effort needed to prevent unrestricted evaluation.

42 Orderings Equational Prover Method and Implementation The prover implements three orderings: LPO: Lexicographic path ordering. KBO: Knuth-Bendix ordering. MPOSV: Multiset path ordering, extended for sequence variables. Comparison wrt to ordering is costly. LPO and MPOSV compare the same pair of terms many times. To speed up the process, results of the comparisons are cashed. On the next attempt of comparison, first the result is looked up in the cash. Cash size can be changed by the user.

43 Critical Pair Generation Equational Prover Method and Implementation Requires unification between a side of the selected equation and subterms of active facts. To avoid many unsuccessful unification attempts, the subterms of active parts are stored in the index. Unifiability retrieval operation for a given term: Goes through the index. If an element in the index has a chance to be unified with the given term, selects it. Passes the selected element and the given term to the unification algorithm that finally decides whether the pair is indeed unifiable or not. Unification algorithm is the Robinson algorithm extended with sequence variables in the last argument positions (Unification remans unitary).

44 Existential Goals Equational Prover Method and Implementation If the goal contains an existential quantifier, e.g. u s(u) = t(u), then: Introduce a new binary function symbols eq. Introduce two new constants true and false. Add u eq(s(u), t(u)) = false to the knowledge base E. Add x eq(x, x) = true to the knowledge base E. Make a new goal true = false. Run the unfailing completion procedure on the new knowledge base and goal. Keep eye on the binding for u. It will provide the witness term for the original goal.

45 Equational Prover Method and Implementation Equational Problems in Higher Order Form The prover accepts input in the applicative higher order form. The input is translated by Warren s method into first-order syntax. Unfailing completion is run on the problem in the translated form. First-order output is translated back into applicative higher order form. The user sees only higher order input and output, while the deduction is performed on the first-order level.

46 Warren s Translation. Example Equational Prover Method and Implementation Example Equality in the applicative higher order form: Translated into first order form: twice(f)(x) = F(F(X)). twice(f, X) = apply(f, apply(f, X)) apply(twice 0, F) = twice 1 (F) apply(twice 1 (F), X) = twice(f, X) where apply is a new binary function and twice 0 and twice 1 are new constructors representing partial applications.

47 Access to Mathematica Built-Ins Equational Prover Method and Implementation Mathematica built-in functions can be incorporated into the deduction process. It should be explicitly declared a function to be a Mathematica built-in function. A function can get its built-in Mathematica meaning only at the phase of checking joinability of the goal. Result of computation is not checked. Rather, a corresponding warning message is issued.

48 Modes Equational Prover Method and Implementation The prover has two proving modes Unfailing completion. Simplification. In the simplification mode: All equalities are (tried to be) oriented with respect to given ordering and are used rewrite the goal. No critical pairs are generated (Existential goals are treated in a special way. Narrowing).

49 Prover Architecture Equational Prover Method and Implementation The prover consists of three parts: 1 Preprocessor: Checks the input syntax, Skolemizes, sets option values, a proving mode, and an ordering. 2 Kernel: Runs a proof procedure (unfailing completion or simplification) with the chosen settings. 3 Proof presenter: Structures the output of the kernel, Deletes redundant steps, Introduces lemmata, Displays the proof. (Based on Proof Communication Language of Denzinger and Schulz)

50 The Last Demo on Equational Prover Method and Implementation Example: A ring with idempotent multiplication is commutative.

51 Reference Equational Prover Method and Implementation T. Kutsia. Equational prover of THEOREMA. In R. Nieuwenhuis, editor, Proc. of the 14th Int. Conf. on Rewriting Techniques and Applications, RTA 03, volume 2706 of LNCS, pages , Valencia, Spain, Springer.

52 in THEOREMA Methods in THEOREMA Matching with Regular Constraints We have already encountered solving examples: Finding unifiers for building critical pairs: term equations. Finding matchers for rewriting: term equations with one ground side. Orienting equalities into rewrite rules: ordering constraints.

53 in THEOREMA Methods in THEOREMA Matching with Regular Constraints Various solving methods have found its way in different parts of the THEOREMA system: Robinson unification. Unification of higher-order patterns. Unification with sequence variables. LPO, KBO, and MPOSV constraints. MATHEMATICA solving algorithms. Matching.... In this talk: Matching with regular constraints.

54 What is Matching? Methods in THEOREMA Matching with Regular Constraints Match a term s to a term t: Find an substitution ϑ such that sϑ and t are identical. t is a ground term. s might contain various kinds of variables: individual, function, sequence, context. Why do we have so many different kinds of variables?

55 Matching Methods in THEOREMA Matching with Regular Constraints A matching substitution should map individual variables to terms, function variables to function symbols/variables, sequence variables to sequences of terms, context variables to contexts (terms with a single "hole"). How to compute matching substitutions?

56 Matching Methods in THEOREMA Matching with Regular Constraints Moreover, some variables that occur in s may be constrained by regular expressions. What is it good for? How to compute matching substitutions that satisfy the constraints?

57 Try to Match Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )) g C f x a f b f a h f C context variable. x sequence variable.

58 First Solution Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )) g C f x a f b f a h f {C g(, h(f (a), f )), x a, b }

59 Second Solution Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )) g C f x a f b f a h f {C g(f (a, b), h(, f )), x a}

60 Third Solution Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )) g C f x a f b f a h f {C g(f (a, b), h(f (a), )), x }

61 Methods in THEOREMA Matching with Regular Constraints Same Example, with a Regular Constraint C(f (x)) g(f (a, b), h(f (a), f )), x in a, b g C f x a f b f a h f Find a matcher σ such that xσ {, a, b, a, b, a, b,...}.

62 First Solution Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )), x in a, b g C f x a f b f a h f {C g(, h(f (a), f )), x a, b }

63 Second Solution Methods in THEOREMA Matching with Regular Constraints C(f (x)) g(f (a, b), h(f (a), f )), x in a, b g C f x a f b f a h f {C g(f (a, b), h(f (a), )), x }

64 Variables Methods in THEOREMA Matching with Regular Constraints In context sequence matching, variables help to explore terms (represented as trees) both in breadth and in depth: Individual Sequence Function Context Direction breadth breadth depth depth Steps one any one any

65 In This Talk Methods in THEOREMA Matching with Regular Constraints Description of a framework for matching with context and sequence variables. Integration of regular constraints into matching.

66 Terms Methods in THEOREMA Matching with Regular Constraints Built over 1 Individual and sequence variables 2 Function and context variables 3 A distinguished constant (hole) 4 Flexible arity function symbols

67 Terms Methods in THEOREMA Matching with Regular Constraints More formally: t ::= x x f (t 1,..., t n ) F(t 1,..., t n ) C(t) where 1 x is an individual variable 2 x is a sequence variable 3 f is a function symbol 4 F is a function variable 5 C is a context variable 6 t in C(t) is not a sequence variable

68 Contexts Methods in THEOREMA Matching with Regular Constraints Context: A term with a single occurrence of the hole. Example (Contexts) f (a, g(x, ), b) C(f (a, F( ), x)) C( ) Convention: a, b abbreviate a() and b().

69 Substitutions Methods in THEOREMA Matching with Regular Constraints Mapping: From To Condition Individual Term t t is not a sequence variable variable x t contains no holes t x Sequence Term sequence n 0, variable x t 1,..., t n t s contain no holes if n = 1 then t 1 x Function Function symbols H F variable F and variables H Context Context C C C( ) variable C For finitely many variables.

70 Context Application Methods in THEOREMA Matching with Regular Constraints Operation to "fill up holes C: context t: term that is not a sequence variable C[t] (Application of C on t): A term obtained from C by replacing the hole with t. Example C t C[t] f (a, ) f (b, h(x)) f (a, f (b, h(x))) f (x, C(F(x, )), y) f (x, C(F (x, )), y) f (C(F (x,, y))) g(, ) f (C(F(x, g(, ), y)))

71 Substitution Extension Methods in THEOREMA Matching with Regular Constraints Substitutions are extended to terms: xσ = σ(x) xσ = σ(x) f (t 1,..., t n )σ = f (t 1 σ,..., t n σ) F (t 1,..., t n )σ = σ(f)(t 1 σ,..., t n σ) C(t)σ = σ(c)[tσ].

72 Substitution Extension Methods in THEOREMA Matching with Regular Constraints Example t = D(g(x, y)) σ = {D, x x, C(f (a)), y } tσ = g(x, C(f (a)))

73 Matching Problem, Matcher Methods in THEOREMA Matching with Regular Constraints Matching Problem: a finite multiset of term pairs (matching equations) {s 1 t 1,..., s n t n } s s and the t s contain no holes s s are not sequence variables t s are ground Matcher: a substitution σ such that s 1 σ = t 1,..., s n σ = t n

74 Regular CSM Algorithm Methods in THEOREMA Matching with Regular Constraints The regular context sequence matching algorithm M R is constructed in two steps: 1 Constructing the basic matching algorithm M for unconstrained equations. 2 Extending M with the rules for solving constrained equations.

75 Basic Matching Algorithm M Methods in THEOREMA Matching with Regular Constraints A rule-based algorithm that operates on matching problem/substitution pairs, is sound, terminating, and complete, computes minimal complete set of matchers for solvable problems, reports failure for unsolvable problems. Sample rule Details in [1].

76 Example Methods in THEOREMA Matching with Regular Constraints From a tree extract contexts under which two equal leaves lie. Problem: {F(, C(G()),, D(G()), ) f (a, g(b, c), b, d)}. F, G: function variables, C, D: context variables, : anonymous sequence variables. (Singleton variables whose values are not computed.) Solution: σ = {F f, C g(, c), G b, D }.

77 Regular Expressions Methods in THEOREMA Matching with Regular Constraints A powerful mechanism for restricting data values. Widely used in general-purpose programming and querying semistructured data. Classical approach for regular expression matching: using finite automata. Can be easily integrated into our matching framework.

78 Methods in THEOREMA Matching with Regular Constraints Regular Expressions on Terms and Contexts Regular expressions on terms: R ::= t R 1, R 2 R 1 R 2 R. where t contains no holes. Regular expressions on contexts: Q ::= C Q 1, Q 2 Q 1 Q 2 Q.

79 Regular Expressions on Terms Methods in THEOREMA Matching with Regular Constraints Regular expressions on terms generate regular hedge languages. Example L( f (x, a, x), C(b) ) = {, f (x, a, x), C(b), f (x, a, x), C(b), f (x, a, x), C(b),...}

80 Regular Expressions on Contexts Methods in THEOREMA Matching with Regular Constraints Regular expressions on contexts generate regular tree languages. Example L( f (, a, x), C( ) ) = {, f (C( ), a, x), f (C(f (C( ), a, x)), a, x),...}

81 Regular Constraints. Notation Methods in THEOREMA Matching with Regular Constraints Term regular constraints: (Ts in R, 0), (Ts in R, 1). 0, 1 boolean values (called flags). Intuition: (Ts in R, 0) the sequence Ts belongs to L(R). (Ts in R, 1) the sequence Ts belongs to L(R) \ { }. Note: (Ts in R, 1) is not the same as (Ts in R, R, 0): ( in (a ), 1) is false. ( in a, (a ), 0) is true.

82 Regular Constraints. Notation Methods in THEOREMA Matching with Regular Constraints Term regular constraints: (Ts in R, 0), (Ts in R, 1). 0, 1 boolean values (called flags). Intuition: (Ts in R, 0) the sequence Ts belongs to L(R). (Ts in R, 1) the sequence Ts belongs to L(R) \ { }. Note: (Ts in R, 1) is not the same as (Ts in R, R, 0): ( in (a ), 1) is false. ( in a, (a ), 0) is true.

83 Regular Constraints. Notation Methods in THEOREMA Matching with Regular Constraints Context regular constraints: (C in Q, 0), (C in Q, 1). Intuition: (C in Q, 0) the context C belongs to L(Q). (C in Q, 1) the sequence C belongs to L(Q) \ { }. Note: (C in Q, 1) is not the same as (C in Q, Q, 0)

84 Regular CSM Problem Methods in THEOREMA Matching with Regular Constraints Multiset of matching equations and regular constraints: {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )}, where all x s and all C s are distinct, do not occur in R s and Q s, (This restriction can be relaxed to noncyclic occurrences.) occur in the matching equations, and all f s and g s are boolean expressions.

85 Methods in THEOREMA Matching with Regular Constraints Solution of a Regular CSM Problem Problem: {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )}. Solution: A substitution σ such that for all 1 i n, 1 j m, and 1 l k: s i σ = t i, x j σ L(R j σ) fj σ, f j σ {0, 1}, where L(R) 0 = L(R), L(R) 1 = L(R) \ { }, C l σ L(Q l σ) gl σ, g l σ {0, 1}, where L(Q) 0 = L(Q), L(Q) 1 = L(Q) \ { },

86 Methods in THEOREMA Matching with Regular Constraints Solution of a Regular CSM Problem Problem: {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )}. Solution: A substitution σ such that for all 1 i n, 1 j m, and 1 l k: s i σ = t i, x j σ L(R j σ) fj σ, f j σ {0, 1}, where L(R) 0 = L(R), L(R) 1 = L(R) \ { }, C l σ L(Q l σ) gl σ, g l σ {0, 1}, where L(Q) 0 = L(Q), L(Q) 1 = L(Q) \ { },

87 Methods in THEOREMA Matching with Regular Constraints Solution of a Regular CSM Problem Problem: {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )}. Solution: A substitution σ such that for all 1 i n, 1 j m, and 1 l k: s i σ = t i, x j σ L(R j σ) fj σ, f j σ {0, 1}, where L(R) 0 = L(R), L(R) 1 = L(R) \ { }, C l σ L(Q l σ) gl σ, g l σ {0, 1}, where L(Q) 0 = L(Q), L(Q) 1 = L(Q) \ { },

88 Methods in THEOREMA Matching with Regular Constraints Solution of a Regular CSM Problem Problem: {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )}. Solution: A substitution σ such that for all 1 i n, 1 j m, and 1 l k: s i σ = t i, x j σ L(R j σ) fj σ, f j σ {0, 1}, where L(R) 0 = L(R), L(R) 1 = L(R) \ { }, C l σ L(Q l σ) gl σ, g l σ {0, 1}, where L(Q) 0 = L(Q), L(Q) 1 = L(Q) \ { },

89 Matching with Regular Constraints Methods in THEOREMA Matching with Regular Constraints Example Regular CSM problem: {C(f (x)) g(f (a, b), h(f (a), f )), (x in a, b, 0)} Solutions: {C g(, h(f (a), f )), x a, b } {C g(f (a, b), h(f (a), )), x }

90 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints A straightforward "generate-and-test approach to solve {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )} : 1 Compute a solution σ for {s 1 t 1,..., s n t n } (e.g. by M) 2 Build an automaton for each R i σ and Q j σ (taking into account the values of f i σ and g j σ) 3 If x i σ and C j σ are accepted by the corresponding automata then add σ to the answer set else discard σ.

91 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints A straightforward "generate-and-test approach to solve {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )} : 1 Compute a solution σ for {s 1 t 1,..., s n t n } (e.g. by M) 2 Build an automaton for each R i σ and Q j σ (taking into account the values of f i σ and g j σ) 3 If x i σ and C j σ are accepted by the corresponding automata then add σ to the answer set else discard σ.

92 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints A straightforward "generate-and-test approach to solve {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )} : 1 Compute a solution σ for {s 1 t 1,..., s n t n } (e.g. by M) 2 Build an automaton for each R i σ and Q j σ (taking into account the values of f i σ and g j σ) 3 If x i σ and C j σ are accepted by the corresponding automata then add σ to the answer set else discard σ.

93 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints A straightforward "generate-and-test approach to solve {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )} : 1 Compute a solution σ for {s 1 t 1,..., s n t n } (e.g. by M) 2 Build an automaton for each R i σ and Q j σ (taking into account the values of f i σ and g j σ) 3 If x i σ and C j σ are accepted by the corresponding automata then add σ to the answer set else discard σ.

94 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints A straightforward "generate-and-test approach to solve {s 1 t 1,..., s n t n, (x 1 in R 1, f 1 ),..., (x m in R m, f m ), (C 1 in Q 1, g 1 ),..., (C k in Q k, g k )} : 1 Compute a solution σ for {s 1 t 1,..., s n t n } (e.g. by M) 2 Build an automaton for each R i σ and Q j σ (taking into account the values of f i σ and g j σ) 3 If x i σ and C j σ are accepted by the corresponding automata then add σ to the answer set else discard σ. Problematic when regular expressions are nonlinear, contain variables that do not occur in matching equations.

95 Regular CSM Problems Methods in THEOREMA Matching with Regular Constraints We propose a different approach: Integrate regular constraints into matching algorithm. Compute the right answers directly. Save the effort of automata construction and testing for each computed substitution. Regular expressions can be nonlinear. No problem. Regular expressions can contain variables that do not occur in matching equations. No problem.

96 Methods in THEOREMA Matching with Regular Constraints Matching Algorithm M R for Regular CSM Problems A rule based algorithm that extends context sequence matching algorithm M, is sound, terminating, and complete, computes the minimal complete set of matchers for solvable problems, reports failure for unsolvable problems. Sample rule Details in [1].

97 Example Methods in THEOREMA Matching with Regular Constraints Problem: {C(h(x, b, y)) f (a, g(f (a, g(h(b, b, b))))), D(h(y, x)) f (a, g(h(b, b))), (x in y, 0), (C in E( ), 0), (D in E( ), 0)}. Solution: {{ C f (a, g(f (a, g( )))), E f (a, g( )), D f (a, g( )), x, y b, b }, { C f (a, g(f (a, g( )))), E f (a, g( )), D f (a, g( )), x b, y b}}.

98 Applications Methods in THEOREMA Matching with Regular Constraints Some of the applications of (regular) CSM: Rule-based programming XML querying and transformation Schema matching

99 Related Work Methods in THEOREMA Matching with Regular Constraints Rich literature on matching with regular expressions. Approaches closer to ours: Regular expression pattern matching (Hosoya and Pierce, 2003). A rewrite system with incomplete regular expression types (Suzuki and Okui, 2005). CLP(Flex): Constraint logic programming applied to XML processing (Coelho and Florido, 2004).

100 Summarizing Basic Features Methods in THEOREMA Matching with Regular Constraints Context sequence matching with regular constraints allows to explore term trees in two orthogonal directions: in depth and in breadth, gives more freedom in selecting subterms, has a finite minimal complete set of solutions, if used as a computational mechanism for a declarative, rule-based language to query and transform XML, can give it the advantages from both path-based and pattern-based languages.

101 Summarizing Basic Features Methods in THEOREMA Matching with Regular Constraints Context sequence matching with regular constraints allows to explore term trees in two orthogonal directions: in depth and in breadth, gives more freedom in selecting subterms, has a finite minimal complete set of solutions, if used as a computational mechanism for a declarative, rule-based language to query and transform XML, can give it the advantages from both path-based and pattern-based languages.

102 Summarizing Basic Features Methods in THEOREMA Matching with Regular Constraints Context sequence matching with regular constraints allows to explore term trees in two orthogonal directions: in depth and in breadth, gives more freedom in selecting subterms, has a finite minimal complete set of solutions, if used as a computational mechanism for a declarative, rule-based language to query and transform XML, can give it the advantages from both path-based and pattern-based languages.

103 Summarizing Basic Features Methods in THEOREMA Matching with Regular Constraints Context sequence matching with regular constraints allows to explore term trees in two orthogonal directions: in depth and in breadth, gives more freedom in selecting subterms, has a finite minimal complete set of solutions, if used as a computational mechanism for a declarative, rule-based language to query and transform XML, can give it the advantages from both path-based and pattern-based languages.

104 Summarizing Basic Features Methods in THEOREMA Matching with Regular Constraints Context sequence matching with regular constraints allows to explore term trees in two orthogonal directions: in depth and in breadth, gives more freedom in selecting subterms, has a finite minimal complete set of solutions, if used as a computational mechanism for a declarative, rule-based language to query and transform XML, can give it the advantages from both path-based and pattern-based languages.

105 Reference Methods in THEOREMA Matching with Regular Constraints T. Kutsia and M. Marin. Matching with Regular Constraints. In G. Sutcliffe and A. Voronkov, editors, Proc. of the 12th Int. Conf. on Logic in Programming, Artificial Intelligence, and Reasoning, LPAR 05, volume 3835 of LNAI, pages , Montego Bay, Jamaica, Springer.

106 Summary Methods in THEOREMA Matching with Regular Constraints THEOREMA supports proving and solving aspects of equational reasoning. : Unfailing completion based equational prover for unit equality problems. First order and applicative higher order syntax. Sequence variables. by simplification. Human-oriented input and output. : Unification and matching algorithms for various theories. Symbolic constraint solving. Regular expressions.

107 Inference Rules of M Appendix CSM Algorithm M Regular CSM Algorithm M R Trivial: Individual Variable Elimination: {t t} Γ ; σ = Γ ; σ. {x t} Γ ; σ = Γ ϑ; σϑ, where ϑ = {x t}. Function Variable Elimination: {F(s 1,..., s n ) f (t 1,..., t m )} Γ ; σ = {f (s 1 ϑ,..., s n ϑ) f (t 1,..., t m )} Γ ϑ; σϑ, where ϑ = {F f }. Back

108 Inference Rules of M Appendix CSM Algorithm M Regular CSM Algorithm M R Total Decomposition: {f (s 1,..., s n ) f (t 1,..., t n )} Γ ; σ = {s 1 t 1,..., s n t n } Γ ; σ, if f (s 1,..., s n ) f (t 1,..., t n ) and s i / V Seq for all 1 i n. Partial Decomposition: {f (s 1,..., s n ) f (t 1,..., t m )} Γ ; σ = {s 1 t 1,..., s k 1 t k 1, f (s k,..., s n ) f (t k,..., t m )} Γ ; σ, if f (s 1,..., s n ) f (t 1,..., t m ), s k V Seq for some 1 < k min(n, m) + 1, and s i / V Seq for all 1 i < k. Back

109 Inference Rules of M Appendix CSM Algorithm M Regular CSM Algorithm M R Sequence Variable Deletion: {f (x, s 1,..., s n ) t} Γ ; σ = {f (s 1 ϑ,..., s n ϑ) t} Γ ϑ; σϑ, where ϑ = {x }. Widening: {f (x, s 1,..., s n ) f (t, t 1,..., t m )} Γ ; σ = {f (x, s 1 ϑ,..., s n ϑ) f (t 1,..., t m )} Γ ϑ; σϑ, where ϑ = {x t, x }. Back

110 Inference Rules of M Appendix CSM Algorithm M Regular CSM Algorithm M R Context Variable Deletion: {C(s) t} Γ ; σ = {sϑ t} Γ ϑ; σϑ, where ϑ = {C }. Deepening: {C(s) f (t 1,..., t m )} Γ ; σ = {C(sϑ) t j } Γ ϑ; σϑ, where ϑ = {C f (t 1,..., t j 1, C( ), t j+1,..., t m )} for some 1 j m, and m > 0. Back

111 Inference Rules of M Appendix CSM Algorithm M Regular CSM Algorithm M R Symbol Clash: {f (s 1,..., s n ) g(t 1,..., t m )} Γ ; σ =, if f / V Con V Fun and f g. Arity Disagreement: {f (s 1,..., s n ) f (t 1,..., t m )} Γ ; σ =, if m n and s i / V Seq for all 1 i n. Back

112 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Empty Sequence in Term Regular Expression: {f (x, s 1,..., s n ) t, (x in, f)} Γ; σ = { {f (x, s1,..., s n )ϑ t} Γϑ; σϑ, if f = 0, if f = 1. where ϑ = {x }. Term in Term Regular Expression: {f (x, s 1,..., s n ) t, (x in s, f)} Γ; σ = {f (x, s 1,..., s n )ϑ t} Γϑ; σϑ, where ϑ = {x s} and s / V Seq. Back

113 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Sequence Variable in Term Regular Expression: {f (x, s 1,..., s n ) t, (x in y, f)} Γ; σ = {f (x, s 1,..., s n )ϑ t} Γϑ; σϑ, where ϑ = {x y} if f = 0. If f = 1 then ϑ = {x y, y, y y, y } where y is a fresh variable. Choice in Term Regular Expression: {f (x, s 1,..., s n ) t, (x in R 1 R 2, f)} Γ; σ = {f (x, s 1,..., s n )ϑ t, (y i in R i, f)} Γϑ; σϑ, for i = 1, 2, where y i s are fresh variables and ϑ = {x y i }. Back

114 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Concatenation in Term Regular Expression: {f (x, s 1,..., s n ) t, (x in R 1, R 2, f)} Γ; σ = {f (x, s 1,..., s n )ϑ t, (y 1 in R 1, f 1 ), (y 2 in R 2, f 2 )} Γϑ; σϑ, where y 1 and y 2 are fresh variables, ϑ = {x y 1, y 2 }, and f 1 and f 2 are computed as follows: If f = 0 then f 1 = f 2 = 0 else f 1 = 0 and f 2 = NonEmptySeq(y 1 ) XOR 1. NonEmptySeq() = 0 NonEmptySeq(r 1,..., r n ) = 1 if r i / V Seq for some 1 i n. Back

115 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Repetition in Term Regular Expression 1: {f (x, s 1,..., s n ) t, (x in R, f)} Γ; σ = { {f (x, s1,..., s n )ϑ t} Γϑ; σϑ, if f = 0, if f = 1. where ϑ = {x }. Repetition in Term Regular Expression 2: {f (x, s 1,..., s n ) t, (x in R, f)} Γ; σ = {f (x, s 1,..., s n )ϑ t, (y in R, 1), (x in R, 0)} Γϑ; σϑ, where y is a fresh variable and ϑ = {x y, x }. Back

116 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Hole in Context Regular Expression: where ϑ = {C }. {C(s) t, (C in, g)} Γ; σ = { {C(s)ϑ t} Γϑ; σϑ, if g = 0, if g = 1. Context in Context Regular Expression: {C(s) t, (C in C, g)} Γ; σ = {C(s)ϑ t} Γϑ; σϑ, where C, Head(C) / V Con, and ϑ = {C C}. Back

117 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Context Variable in Context Regular Expression: {C(s) t, (C in D( ), g)} Γ; σ = {C(s)ϑ t} Γϑ; σϑ, where ϑ = {C D( )} if g = 0. If g = 1 then ϑ = {C F(x, D( ), y), D F(x, D( ), y)}, where F, x, and y are fresh variables. Choice in Context Regular Expression: {C(s) t, (C in Q 1 Q 2, g)} Γ; σ = {C(s)ϑ t, (D i in Q i, g)} Γϑ; σϑ, for i = 1, 2, where D i s are fresh variables and ϑ = {C D i ( )}. Back

118 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Concatenation in Context Regular Expression: {C(s) t, (C in Q 1, Q 2, g)} Γ; σ = {C(s)ϑ t, (D 1 in Q 1, g 1 ), (D 2 in Q 2, g 2 )} Γϑ; σϑ, where D 1 and D 2 are fresh variables, ϑ = {C D 1 (D 2 ( ))}, and g 1 and g 2 are computed as follows: If g = 0 then g 1 = g 2 = 0 else g 1 = 0 and g 2 = NonEmptyCtx(D 1 ) XOR 1. NonEmptyCtx( ) = 0. NonEmptyCtx(C) = 1 if the context C contains at least one symbol different from context variables and the hole constant. Back

119 Appendix CSM Algorithm M Regular CSM Algorithm M R Inference Rules of M R Repetition in Context Regular Expression 1: where ϑ = {C }. {C(s) t, (C in Q, g)} Γ; σ = { {C(s)ϑ t} Γϑ; σϑ, if g = 0, if g = 1. Repetition in Context Regular Expression 2: {C(s) t, (C in Q, g)} Γ; σ = {C(s)ϑ t, (D in Q, 1), (C in Q, 0)} Γϑ; σϑ, where D is a fresh variable and ϑ = {C D(C( ))}. Back

Matching with Regular Constraints

Matching with Regular Constraints Matching with Regular Constraints Temur Kutsia 1 and Mircea Marin 2 1 Research Institute for Symbolic Computation Johannes Kepler University, A-4040 Linz, Austria tkutsia@risc.uni-linz.ac.at 2 Graduate

More information

Rewriting. Andreas Rümpel Faculty of Computer Science Technische Universität Dresden Dresden, Germany.

Rewriting. Andreas Rümpel Faculty of Computer Science Technische Universität Dresden Dresden, Germany. Rewriting Andreas Rümpel Faculty of Computer Science Technische Universität Dresden Dresden, Germany s9843882@inf.tu-dresden.de ABSTRACT This is an overview paper regarding the common technologies of rewriting.

More information

Automated Termination Proofs with AProVE

Automated Termination Proofs with AProVE Automated Termination Proofs with AProVE Jürgen Giesl, René Thiemann, Peter Schneider-Kamp, Stephan Falke LuFG Informatik II, RWTH Aachen, Ahornstr. 55, 52074 Aachen, Germany {giesl thiemann psk}@informatik.rwth-aachen.de

More information

Programming with Transformation Rules

Programming with Transformation Rules Programming with Transformation Rules Mircea Marin 1 and Temur Kutsia 2 1 Johann Radon Institute for Computational and Applied Mathematics Austrian Academy of Sciences A-4040 Linz, Austria mircea.marin@oeaw.ac.at

More information

Functional Logic Programming: From Theory to Curry

Functional Logic Programming: From Theory to Curry Functional Logic Programming: From Theory to Curry Michael Hanus Institut für Informatik, CAU Kiel, D-24098 Kiel, Germany. mh@informatik.uni-kiel.de Abstract. Functional logic programming languages combine

More information

Towards a Safe Partial Evaluation of Lazy Functional Logic Programs

Towards a Safe Partial Evaluation of Lazy Functional Logic Programs WFLP 2007 Towards a Safe Partial Evaluation of Lazy Functional Logic Programs Sebastian Fischer 1 Department of Computer Science, University of Kiel Olshausenstr. 40, D-24098, Kiel, Germany Josep Silva

More information

Lecture Note: Types. 1 Introduction 2. 2 Simple Types 3. 3 Type Soundness 6. 4 Recursive Types Subtyping 17

Lecture Note: Types. 1 Introduction 2. 2 Simple Types 3. 3 Type Soundness 6. 4 Recursive Types Subtyping 17 Jens Palsberg Sep 24, 1999 Contents Lecture Note: Types 1 Introduction 2 2 Simple Types 3 3 Type Soundness 6 4 Recursive Types 12 5 Subtyping 17 6 Decision Procedure for Subtyping 19 7 First-Order Unification

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p.

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p. CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections 10.1-10.3 p. 1/106 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Automated Reasoning Systems

Automated Reasoning Systems Automated Reasoning Systems Resolution Theorem Proving: Prover9 Temur Kutsia RISC, Johannes Kepler University of Linz, Austria kutsia@risc.uni-linz.ac.at May 11, 2011 Prover9 Automated theorem prover from

More information

Defining Datalog in Rewriting Logic

Defining Datalog in Rewriting Logic M. A. Feliú Universidad Politécnica de Valencia, DSIC / ELP Joint work with María Alpuente, Christophe Joubert and A. Villanueva Coimbra, September 2009 Motivation Recent interest in defining complex interprocedural

More information

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

Decision Procedures for Recursive Data Structures with Integer Constraints

Decision Procedures for Recursive Data Structures with Integer Constraints Decision Procedures for Recursive Data Structures with Ting Zhang, Henny B Sipma, Zohar Manna Stanford University tingz,sipma,zm@csstanfordedu STeP Group, June 29, 2004 IJCAR 2004 - p 1/31 Outline Outline

More information

System Description: iprover An Instantiation-Based Theorem Prover for First-Order Logic

System Description: iprover An Instantiation-Based Theorem Prover for First-Order Logic System Description: iprover An Instantiation-Based Theorem Prover for First-Order Logic Konstantin Korovin The University of Manchester School of Computer Science korovin@cs.man.ac.uk Abstract. iprover

More information

Lecture #23: Conversion and Type Inference

Lecture #23: Conversion and Type Inference Lecture #23: Conversion and Type Inference Administrivia. Due date for Project #2 moved to midnight tonight. Midterm mean 20, median 21 (my expectation: 17.5). Last modified: Fri Oct 20 10:46:40 2006 CS164:

More information

Rewriting Needs Constraints and Constraints Need Rewriting

Rewriting Needs Constraints and Constraints Need Rewriting Rewriting Needs Constraints and Constraints Need Rewriting José Meseguer Department of Computer Science, UIUC ints 14 November 2008 Motivation Symbolic Computation, Rewriting, and Constraints Rewriting

More information

Slothrop: Knuth-Bendix Completion with a Modern Termination Checker

Slothrop: Knuth-Bendix Completion with a Modern Termination Checker Slothrop: Knuth-Bendix Completion with a Modern Termination Checker Ian Wehrman, Aaron Stump, and Edwin Westbrook Dept. of Computer Science and Engineering Washington University in St. Louis St. Louis,

More information

Progress Report: Term Dags Using Stobjs

Progress Report: Term Dags Using Stobjs Progress Report: Term Dags Using Stobjs J.-L. Ruiz-Reina, J.-A. Alonso, M.-J. Hidalgo and F.-J. Martín-Mateos http://www.cs.us.es/{~jruiz, ~jalonso, ~mjoseh, ~fmartin} Departamento de Ciencias de la Computación

More information

of our toolkit of data structures and algorithms for automated deduction in rst-order

of our toolkit of data structures and algorithms for automated deduction in rst-order The Barcelona Prover ROBERT NIEUWENHUIS, JOSE MIGUEL RIVERO and MIGUEL ANGEL VALLEJO Technical University of Catalonia Barcelona, Spain roberto@lsi.upc.es Abstract. Here we describe the equational theorem

More information

Conversion vs. Subtyping. Lecture #23: Conversion and Type Inference. Integer Conversions. Conversions: Implicit vs. Explicit. Object x = "Hello";

Conversion vs. Subtyping. Lecture #23: Conversion and Type Inference. Integer Conversions. Conversions: Implicit vs. Explicit. Object x = Hello; Lecture #23: Conversion and Type Inference Administrivia. Due date for Project #2 moved to midnight tonight. Midterm mean 20, median 21 (my expectation: 17.5). In Java, this is legal: Object x = "Hello";

More information

In Our Last Exciting Episode

In Our Last Exciting Episode In Our Last Exciting Episode #1 Lessons From Model Checking To find bugs, we need specifications What are some good specifications? To convert a program into a model, we need predicates/invariants and

More information

Tsukuba Termination Tool

Tsukuba Termination Tool Tsukuba Termination Tool Nao Hirokawa 1 and Aart Middeldorp 2 1 Master s Program in Science and Engineering University of Tsukuba, Tsukuba 305-8573, Japan nao@score.is.tsukuba.ac.jp 2 Institute of Information

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

Implementation of Lambda-Free Higher-Order Superposition. Petar Vukmirović

Implementation of Lambda-Free Higher-Order Superposition. Petar Vukmirović Implementation of Lambda-Free Higher-Order Superposition Petar Vukmirović Automatic theorem proving state of the art FOL HOL 2 Automatic theorem proving challenge HOL High-performance higher-order theorem

More information

}Optimization Formalisms for recursive queries. Module 11: Optimization of Recursive Queries. Module Outline Datalog

}Optimization Formalisms for recursive queries. Module 11: Optimization of Recursive Queries. Module Outline Datalog Module 11: Optimization of Recursive Queries 11.1 Formalisms for recursive queries Examples for problems requiring recursion: Module Outline 11.1 Formalisms for recursive queries 11.2 Computing recursive

More information

Lecture Notes in Computer Science, Proceedings of the 16th Internationa RTA 2005, Nara, Japan, April 19-21,

Lecture Notes in Computer Science, Proceedings of the 16th Internationa RTA 2005, Nara, Japan, April 19-21, JAIST Reposi https://dspace.j Title Tyrolean Termination Tool Author(s)Hirokawa, Nao; Middeldorp, Aart Citation Lecture Notes in Computer Science, 3 175-184 Issue Date 2005 Type Journal Article Text version

More information

Uncertain Data Models

Uncertain Data Models Uncertain Data Models Christoph Koch EPFL Dan Olteanu University of Oxford SYNOMYMS data models for incomplete information, probabilistic data models, representation systems DEFINITION An uncertain data

More information

If a program is well-typed, then a type can be inferred. For example, consider the program

If a program is well-typed, then a type can be inferred. For example, consider the program CS 6110 S18 Lecture 24 Type Inference and Unification 1 Type Inference Type inference refers to the process of determining the appropriate types for expressions based on how they are used. For example,

More information

Adding GADTs to OCaml the direct approach

Adding GADTs to OCaml the direct approach Adding GADTs to OCaml the direct approach Jacques Garrigue & Jacques Le Normand Nagoya University / LexiFi (Paris) https://sites.google.com/site/ocamlgadt/ Garrigue & Le Normand Adding GADTs to OCaml 1

More information

}Optimization. Module 11: Optimization of Recursive Queries. Module Outline

}Optimization. Module 11: Optimization of Recursive Queries. Module Outline Module 11: Optimization of Recursive Queries Module Outline 11.1 Formalisms for recursive queries 11.2 Computing recursive queries 11.3 Partial transitive closures User Query Transformation & Optimization

More information

Chapter 2 The Language PCF

Chapter 2 The Language PCF Chapter 2 The Language PCF We will illustrate the various styles of semantics of programming languages with an example: the language PCF Programming language for computable functions, also called Mini-ML.

More information

AND-OR GRAPHS APPLIED TO RUE RESOLUTION

AND-OR GRAPHS APPLIED TO RUE RESOLUTION AND-OR GRAPHS APPLIED TO RUE RESOLUTION Vincent J. Digricoli Dept. of Computer Science Fordham University Bronx, New York 104-58 James J, Lu, V. S. Subrahmanian Dept. of Computer Science Syracuse University-

More information

CafeOBJ. CafeOBJ. Starting CafeOBJ. Wolfgang Schreiner 1. A Quick Overview. 2.

CafeOBJ. CafeOBJ. Starting CafeOBJ. Wolfgang Schreiner 1. A Quick Overview. 2. CafeOBJ Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at 1. A Quick Overview Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at

More information

SPASS Version 3.5. Christoph Weidenbach, Dilyana Dimova, Arnaud Fietzke, Rohit Kumar, Martin Suda, and Patrick Wischnewski

SPASS Version 3.5. Christoph Weidenbach, Dilyana Dimova, Arnaud Fietzke, Rohit Kumar, Martin Suda, and Patrick Wischnewski SPASS Version 3.5 Christoph Weidenbach, Dilyana Dimova, Arnaud Fietzke, Rohit Kumar, Martin Suda, and Patrick Wischnewski Max-Planck-Institut für Informatik, Campus E1 4 D-66123 Saarbrücken spass@mpi-inf.mpg.de

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

CS422 - Programming Language Design

CS422 - Programming Language Design 1 CS422 - Programming Language Design From SOS to Rewriting Logic Definitions Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign In this chapter we show how SOS language

More information

Multi-paradigm Declarative Languages

Multi-paradigm Declarative Languages Michael Hanus (CAU Kiel) Multi-paradigm Declarative Languages ICLP 2007 1 Multi-paradigm Declarative Languages Michael Hanus Christian-Albrechts-University of Kiel Programming Languages and Compiler Construction

More information

System Description: Analytica 2

System Description: Analytica 2 System Description: Analytica 2 Edmund Clarke, Michael Kohlhase, Joël Ouaknine, Klaus Sutner Carnegie Mellon University {emc kohlhase ouaknine sutner}@cs.cmu.edu Abstract. The Analytica system is a theorem

More information

Computing Fundamentals 2 Introduction to CafeOBJ

Computing Fundamentals 2 Introduction to CafeOBJ Computing Fundamentals 2 Introduction to CafeOBJ Lecturer: Patrick Browne Lecture Room: K408 Lab Room: A308 Based on work by: Nakamura Masaki, João Pascoal Faria, Prof. Heinrich Hußmann. See notes on slides

More information

Program Calculus Calculational Programming

Program Calculus Calculational Programming Program Calculus Calculational Programming National Institute of Informatics June 21 / June 28 / July 5, 2010 Program Calculus Calculational Programming What we will learn? Discussing the mathematical

More information

Arbitrary-rank polymorphism in (GHC) Haskell

Arbitrary-rank polymorphism in (GHC) Haskell Arbitrary-rank polymorphism in (GHC) Haskell CAS 743 Stephen Forrest 20 March 2006 Damas-Milner Type System A Damas-Milner type system (also called Hindley-Milner) is a traditional type system for functional

More information

Evaluation Trees for Proposition Algebra

Evaluation Trees for Proposition Algebra Evaluation Trees for Proposition Algebra Alban Ponse joined work with Jan A. Bergstra section Theory of Computer Science Informatics Institute, University of Amsterdam https://staff.fnwi.uva.nl/a.ponse/

More information

Lecture #13: Type Inference and Unification. Typing In the Language ML. Type Inference. Doing Type Inference

Lecture #13: Type Inference and Unification. Typing In the Language ML. Type Inference. Doing Type Inference Lecture #13: Type Inference and Unification Typing In the Language ML Examples from the language ML: fun map f [] = [] map f (a :: y) = (f a) :: (map f y) fun reduce f init [] = init reduce f init (a ::

More information

Unification in Maude. Steven Eker

Unification in Maude. Steven Eker Unification in Maude Steven Eker 1 Unification Unification is essentially solving equations in an abstract setting. Given a signature Σ, variables X and terms t 1, t 2 T (Σ) we want to find substitutions

More information

Automated Reasoning. Natural Deduction in First-Order Logic

Automated Reasoning. Natural Deduction in First-Order Logic Automated Reasoning Natural Deduction in First-Order Logic Jacques Fleuriot Automated Reasoning Lecture 4, page 1 Problem Consider the following problem: Every person has a heart. George Bush is a person.

More information

Lee Pike. June 3, 2005

Lee Pike. June 3, 2005 Proof NASA Langley Formal Methods Group lee.s.pike@nasa.gov June 3, 2005 Proof Proof Quantification Quantified formulas are declared by quantifying free variables in the formula. For example, lem1: LEMMA

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Lambda Calculus and Type Inference

Lambda Calculus and Type Inference Lambda Calculus and Type Inference Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ August 17, 2007 Lambda Calculus and Type

More information

Bliksem 1.10 User Manual

Bliksem 1.10 User Manual Bliksem 1.10 User Manual H. de Nivelle January 2, 2003 Abstract Bliksem is a theorem prover that uses resolution with paramodulation. It is written in portable C. The purpose of Bliksem was to develope

More information

Logicographic Symbols: A New Feature in Theorema

Logicographic Symbols: A New Feature in Theorema Logicographic Symbols: A New Feature in Theorema Bruno Buchberger RISC (Research Institute for Symbolic Computation) A 4232 Schloss Hagenberg, Austria Buchberger@RISC.Uni-Linz.ac.at Abstract: Theorema

More information

Lambda Calculus and Type Inference

Lambda Calculus and Type Inference Lambda Calculus and Type Inference Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ October 13, 2004 Lambda Calculus and Type

More information

Type Systems COMP 311 Rice University Houston, Texas

Type Systems COMP 311 Rice University Houston, Texas Rice University Houston, Texas 1 Type Systems for Programming Language were invented by mathematicians before electronic computers were invented. What is a type? A meaningful subset of the set of the domain

More information

Inductive Definitions, continued

Inductive Definitions, continued 1 / 27 Inductive Definitions, continued Assia Mahboubi Jan 7th, 2016 2 / 27 Last lecture Introduction to Coq s inductive types: Introduction, elimination and computation rules; Twofold implementation :

More information

Term Algebras with Length Function and Bounded Quantifier Elimination

Term Algebras with Length Function and Bounded Quantifier Elimination with Length Function and Bounded Ting Zhang, Henny B Sipma, Zohar Manna Stanford University tingz,sipma,zm@csstanfordedu STeP Group, September 3, 2004 TPHOLs 2004 - p 1/37 Motivation: Program Verification

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 19 Tuesday, April 3, 2018 1 Introduction to axiomatic semantics The idea in axiomatic semantics is to give specifications

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Automated Termination and Confluence Analysis of Rewrite System

Automated Termination and Confluence Analysis of Rewrite System Automated Termination and Confluence Analysis of Rewrite System Julian Nagele University of Innsbruck, Austria CHUM 4 @ IBM Watson September 8, 2015 Outline Motivation Termination Confluence Certification

More information

Part I Logic programming paradigm

Part I Logic programming paradigm Part I Logic programming paradigm 1 Logic programming and pure Prolog 1.1 Introduction 3 1.2 Syntax 4 1.3 The meaning of a program 7 1.4 Computing with equations 9 1.5 Prolog: the first steps 15 1.6 Two

More information

Basic concepts. Chapter Toplevel loop

Basic concepts. Chapter Toplevel loop Chapter 3 Basic concepts We examine in this chapter some fundamental concepts which we will use and study in the following chapters. Some of them are specific to the interface with the Caml language (toplevel,

More information

Strategies in PρLog. Temur Kutsia. RISC, JKU Linz, Austria

Strategies in PρLog. Temur Kutsia. RISC, JKU Linz, Austria Strategies in PρLog Besik Dundua RISC, JKU Linz, Austria bdundua@risc.uni-linz.ac.at Temur Kutsia RISC, JKU Linz, Austria kutsia@risc.uni-linz.ac.at Mircea Marin University of Tsukuba, Japan mmarin@cs.tsukuba.ac.jp

More information

Polymorphic lambda calculus Princ. of Progr. Languages (and Extended ) The University of Birmingham. c Uday Reddy

Polymorphic lambda calculus Princ. of Progr. Languages (and Extended ) The University of Birmingham. c Uday Reddy 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 6: Polymorphic Type Systems 1. Polymorphic

More information

Simple Unification-based Type Inference for GADTs

Simple Unification-based Type Inference for GADTs Simple Unification-based Type Inference for GADTs Stephanie Weirich University of Pennsylvania joint work with Dimitrios Vytiniotis, Simon Peyton Jones and Geoffrey Washburn Overview Goal: Add GADTs to

More information

Flang typechecker Due: February 27, 2015

Flang typechecker Due: February 27, 2015 CMSC 22610 Winter 2015 Implementation of Computer Languages I Flang typechecker Due: February 27, 2015 Project 3 February 9, 2015 1 Introduction The third project is to implement a type checker for Flang,

More information

Multi-paradigm Declarative Languages

Multi-paradigm Declarative Languages c Springer-Verlag In Proc. of the International Conference on Logic Programming, ICLP 2007. Springer LNCS 4670, pp. 45-75, 2007 Multi-paradigm Declarative Languages Michael Hanus Institut für Informatik,

More information

Automatic Reasoning (Section 8.3)

Automatic Reasoning (Section 8.3) Automatic Reasoning (Section 8.3) Automatic Reasoning Can reasoning be automated? Yes, for some logics, including first-order logic. We could try to automate natural deduction, but there are many proof

More information

Type Processing by Constraint Reasoning

Type Processing by Constraint Reasoning , Martin Sulzmann, Jeremy Wazny 8th November 2006 Chameleon Chameleon is Haskell-style language treats type problems using constraints gives expressive error messages has a programmable type system Developers:

More information

Lecture 5: Declarative Programming. The Declarative Kernel Language Machine. September 12th, 2011

Lecture 5: Declarative Programming. The Declarative Kernel Language Machine. September 12th, 2011 Lecture 5: Declarative Programming. The Declarative Kernel Language Machine September 12th, 2011 1 Lecture Outline Declarative Programming contd Dataflow Variables contd Expressions and Statements Functions

More information

1 Introduction. 3 Syntax

1 Introduction. 3 Syntax CS 6110 S18 Lecture 19 Typed λ-calculus 1 Introduction Type checking is a lightweight technique for proving simple properties of programs. Unlike theorem-proving techniques based on axiomatic semantics,

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

Uncurrying for Termination

Uncurrying for Termination Uncurrying for Termination Nao Hirokawa and Aart Middeldorp Institute of Computer Science University of Innsbruck 6020 Innsbruck, Austria {nao.hirokawa,aart.middeldorp}@uibk.ac.at Abstract. In this note

More information

RELATIONAL REPRESENTATION OF ALN KNOWLEDGE BASES

RELATIONAL REPRESENTATION OF ALN KNOWLEDGE BASES RELATIONAL REPRESENTATION OF ALN KNOWLEDGE BASES Thomas Studer ABSTRACT The retrieval problem for a knowledge base O and a concept C is to find all individuals a such that O entails C(a). We describe a

More information

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f? 1. Prove: A full m-ary tree with i internal vertices contains n = mi + 1 vertices. 2. For a full m-ary tree with n vertices, i internal vertices, and l leaves, prove: (i) i = (n 1)/m and l = [(m 1)n +

More information

The Relational Model

The Relational Model The Relational Model David Toman School of Computer Science University of Waterloo Introduction to Databases CS348 David Toman (University of Waterloo) The Relational Model 1 / 28 The Relational Model

More information

Modular implicits for OCaml how to assert success. Gallium Seminar,

Modular implicits for OCaml how to assert success. Gallium Seminar, Modular implicits for OCaml how to assert success Jacques Garrigue Nagoya University Frédéric Bour Sponsored by Jane Street LLC Gallium Seminar, 14-03-2016 Garrigue & Bour Mdular implicits and success

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

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1 Introduction to Automata Theory BİL405 - Automata Theory and Formal Languages 1 Automata, Computability and Complexity Automata, Computability and Complexity are linked by the question: What are the fundamental

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 49 Plan of the course 1 Relational databases 2 Relational database design 3 Conceptual database design 4

More information

Two Problems. Programming Languages and Compilers (CS 421) Type Inference - Example. Type Inference - Outline. Type Inference - Example

Two Problems. Programming Languages and Compilers (CS 421) Type Inference - Example. Type Inference - Outline. Type Inference - Example Two Problems Programming Languages and Compilers (CS 421) Sasa Misailovic 4110 SC, UIUC https://courses.engr.illinois.edu/cs421/fa2017/cs421a Based in part on slides by Mattox Beckman, as updated by Vikram

More information

The Prototype Verification System PVS

The Prototype Verification System PVS The Prototype Verification System PVS Wolfgang Schreiner Wolfgang.Schreiner@risc.uni-linz.ac.at Research Institute for Symbolic Computation (RISC) Johannes Kepler University, Linz, Austria http://www.risc.uni-linz.ac.at

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

CS 671, Automated Reasoning

CS 671, Automated Reasoning CS 671, Automated Reasoning Lesson 20: Type Constructs based on Intersection (II): dependent records, abstract data types, basic algebra April 3, 2001 Last time we discussed record types and their representation

More information

Proofs and Proof Certification in the TLA + Proof System

Proofs and Proof Certification in the TLA + Proof System Proofs and Proof Certification in the TLA + Proof System Stephan Merz Inria Nancy Grand-Est & LORIA, Villers-lès-Nancy, France Abstract TLA + is a specification language originally designed for specifying

More information

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012

CMPSCI 250: Introduction to Computation. Lecture #7: Quantifiers and Languages 6 February 2012 CMPSCI 250: Introduction to Computation Lecture #7: Quantifiers and Languages 6 February 2012 Quantifiers and Languages Quantifier Definitions Translating Quantifiers Types and the Universe of Discourse

More information

Lecture 1: Conjunctive Queries

Lecture 1: Conjunctive Queries CS 784: Foundations of Data Management Spring 2017 Instructor: Paris Koutris Lecture 1: Conjunctive Queries A database schema R is a set of relations: we will typically use the symbols R, S, T,... to denote

More information

RSL Reference Manual

RSL Reference Manual RSL Reference Manual Part No.: Date: April 6, 1990 Original Authors: Klaus Havelund, Anne Haxthausen Copyright c 1990 Computer Resources International A/S This document is issued on a restricted basis

More information

Principles of Programming Languages

Principles of Programming Languages Principles of Programming Languages Slides by Dana Fisman based on book by Mira Balaban and lecuture notes by Michael Elhadad Lesson 15 Type Inference Collaboration and Management Dana Fisman www.cs.bgu.ac.il/~ppl172

More information

PROTEIN: A PROver with a Theory Extension INterface

PROTEIN: A PROver with a Theory Extension INterface PROTEIN: A PROver with a Theory Extension INterface Peter Baumgartner and Ulrich Furbach Universiät Koblenz Institut für Informatik Rheinau 1 56075 Koblenz, Germany Tel.: +49 261 9119 426, +49 261 9119

More information

Infinite Derivations as Failures

Infinite Derivations as Failures Infinite Derivations as Failures Andrea Corradi and Federico Frassetto DIBRIS, Università di Genova, Italy name.surname@dibris.unige.it Abstract. When operating on cyclic data, programmers have to take

More information

Element Algebra. 1 Introduction. M. G. Manukyan

Element Algebra. 1 Introduction. M. G. Manukyan Element Algebra M. G. Manukyan Yerevan State University Yerevan, 0025 mgm@ysu.am Abstract. An element algebra supporting the element calculus is proposed. The input and output of our algebra are xdm-elements.

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

Review. CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Let bindings (CBV) Adding Stuff. Booleans and Conditionals

Review. CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Let bindings (CBV) Adding Stuff. Booleans and Conditionals Review CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics e ::= λx. e x ee c v ::= λx. e c (λx. e) v e[v/x] e 1 e 2 e 1 e 2 τ ::= int τ τ Γ ::= Γ,x : τ e 2 e 2 ve 2 ve 2 e[e /x]:

More information

15 150: Principles of Functional Programming Some Notes on Regular Expression Matching

15 150: Principles of Functional Programming Some Notes on Regular Expression Matching 15 150: Principles of Functional Programming Some Notes on Regular Expression Matching Michael Erdmann Spring 2018 1 Introduction Regular expression matching is a very useful technique for describing commonly-occurring

More information

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics

Introduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics Brutus Is An Honorable Man HW2 will not be due today. Homework X+1 will never be due until after I have returned Homework X to you. Normally this is never an issue, but I was sick yesterday and was hosting

More information

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus Types Type checking What is a type? The notion varies from language to language Consensus A set of values A set of operations on those values Classes are one instantiation of the modern notion of type

More information

Semantic Subtyping. Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud)

Semantic Subtyping.  Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) Semantic Subtyping Alain Frisch (ENS Paris) Giuseppe Castagna (ENS Paris) Véronique Benzaken (LRI U Paris Sud) http://www.cduce.org/ Semantic Subtyping - Groupe de travail BD LRI p.1/28 CDuce A functional

More information

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets? Diagonalization Cardinalities The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets? We say that a set S has at least as great cardinality as set T, written S T, if

More information

COMP80 Lambda Calculus Programming Languages Slides Courtesy of Prof. Sam Guyer Tufts University Computer Science History Big ideas Examples:

COMP80 Lambda Calculus Programming Languages Slides Courtesy of Prof. Sam Guyer Tufts University Computer Science History Big ideas Examples: COMP80 Programming Languages Slides Courtesy of Prof. Sam Guyer Lambda Calculus Formal system with three parts Notation for functions Proof system for equations Calculation rules called reduction Idea:

More information

Program verification. Generalities about software Verification Model Checking. September 20, 2016

Program verification. Generalities about software Verification Model Checking. September 20, 2016 Program verification Generalities about software Verification Model Checking Laure Gonnord David Monniaux September 20, 2016 1 / 43 The teaching staff Laure Gonnord, associate professor, LIP laboratory,

More information

An LCF-Style Interface between HOL and First-Order Logic

An LCF-Style Interface between HOL and First-Order Logic An LCF-Style Interface between HOL and First-Order Logic Joe Hurd Computer Laboratory University of Cambridge, joe.hurd@cl.cam.ac.uk 1 Introduction Performing interactive proof in the HOL theorem prover

More information

CONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS522 Programming Language Semantics

CONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS522 Programming Language Semantics CONVENTIONAL EXECUTABLE SEMANTICS Grigore Rosu CS522 Programming Language Semantics Conventional Semantic Approaches A language designer should understand the existing design approaches, techniques and

More information