Presentation is loading. Please wait.

Presentation is loading. Please wait.

Many Sorted First-order Logic Student: Liuxing Kan Instructor: William Farmer Dept. of Computing and Software McMaster University, Hamilton, CA.

Similar presentations


Presentation on theme: "Many Sorted First-order Logic Student: Liuxing Kan Instructor: William Farmer Dept. of Computing and Software McMaster University, Hamilton, CA."— Presentation transcript:

1 Many Sorted First-order Logic Student: Liuxing Kan Instructor: William Farmer Dept. of Computing and Software McMaster University, Hamilton, CA

2 Contents Introduction: What is many sorted FOL Syntax: Languages of many sorted FOL Syntax: Terms and Formulas of many sorted FOL Example of Many-sorted FOL Semantics Semantics of many sorted FOL Proof Theory of Many-sorted FOL The completeness of many-sorted logic Reduction many-sorted logic to one-sorted logic Reference

3 Introduction: what is many-sorted FOL Sometimes people want to express properties of structures of different sorts (types). There are plenty of examples of subjects where the semantics of formulas are many- sorted structures. For instance, in geometry, to take a simple and ancient example, we use universes of pointes, lines, angles, triangles, rectangles, polygons, etc. By adding to the formalism of first-order logic the notion of sort, we can obtain a flexible and convenient logic called many-sorted first order logic, which has the same properties as first order logic. In contrast to FOL, in many-sorted FOL, the arguments of function and predicate symbols may have different sorts, and constant and function symbols also have some sorts. Uses of many-sorted logic: abstract data types, semantics and program verification, definition of programming languages, algebras for logic, databases, dynamic logic, semantics of natural languages, computer-aided problem solving, knowledge representation of design, logic programming and automated deduction.

4 Syntax: Languages of many sorted FOL In contrast to standard first-order languages, in many-sorted first order languages, the argument of function and predicate symbols may have different sorts, and constant and function symbols also have some sort. Technically, this means that a many-sorted alphabet is a many-sorted ranked alphabet. (An S-ranked alphabet is pair(Σ,r) consisting of a set Σ together with a function r: Σ→S*×S assigning a rank (u, s) to each symbol f in Σ ) Alphabet of many-sorted first order language: - S U {bool} of sorts containing the special sort bool - Connectives: Λ,ν,→,↔, all of rank (bool.bool, bool), ¬(not) of rank (bool, bool), ┴(of rank (e, bool)); - Quantifiers: ∀, ∃, each of rank (bool, bool); - Variables: a countable set Vs={X 0,X 1,X 2 …}, each variable X i being of rank (e,s). - Auxiliary symbols: “(” and “)” - Equality symbol ≒, of rank (ss, bool)

5 Syntax: Languages of many sorted FOL A (S U {bool})-ranked alphabet L of nonlogical symbols consisting of: - FS: function symbols, FS→S + ×S, assigning a pair r(f)=(u,s) called rank to every function symbol f. The string u is called the arity of f, and the symbol s is the sort of f. - CS s : constants, For every sort s ∈ S, a set CS s of symbols c 0,c 1,…, each of rank (e,s). The family of sets CS s is denoted by CS - PS: predicate symbols, A set PS of symbols P0,P1,…,and a rank function r:PS→S + ×{bool}, assigning a pair r(P)=(u,bool) called rank to each predicate symbol P. The string u is called the arity of P. If u=e, P is a propositional letter. It is assumed that the sets V s, FS, CS s, and PS are disjoint for all s ∈ S. We will refer to a many-sorted first order language with set of nonlogical symbols L as the language L. Many-sorted first order languages obtained by omitting the equality symbol are referred to as many-sorted first order languages without equality.

6 Syntax: Terms and Formulas of M-S FOL Let L=(CS,FS,PS) be a language of many sorted FOL Terms atomic formulas of L are defined as follows: - Each constant and each variable of sort sis a term of L. - If t 1,…,t n are terms, each t i of sort u i, and f is function symbol of rank (u 1 …u n,s), then ft 1 …t n is a term of sort s - Each propositional letter is an atomic formula. - If t 1,…,t n are terms, each t i of sort u i, and P is a predicate symbol of arity u 1 …u n, then Pt 1 …t n is an atomic formula: Formulas are defined as follows: - Every atomic formula is a formula - For any two formula A and B, (AΛB), (AνB), (A →B), (A↔B ), ¬A are also formula - For any variable x i of sort s and any formula A, ∀ s x i A and ∃ s x i A are also formulas

7 Example of Many-sorted FOL Let L be following many-sorted first order language for stacks, where S={stack, integer}, CSinterger={0}, CSstack={Λ}, FS={Succ, +, *, push, pop, top}, and PS={<} The rank functions are given by: - r(succ)=(integer, integer); - r(+)=r(*)=(integer.integer, integer); - r(push)=(stack.integer, stack); - r(pop)=(stack, stack); - r(top)=(stack, integer); - r(<)=(integer.integer, bool); Then, the following are terms: Succ 0 top push Λ Succ 0 The following are formulas: < 0 Succ 0 ∀ integer x ∀ stack y ≒ stack pop push y x y

8 Semantics of many sorted FOL Many-sorted first order structures - First, let define many-sorted Σ-algebra A is a pair, where A=(A s )s ∈ S is an S- indexed family of nonempty sets, each A s being called a carrier of sort s, and I is an interpretation function assigning functions to the function symbols. - Give a many-sorted first order language L, a many-sorted L-structure M is a many- sorted L-algebra, such that the carrier of sort bool is the set BOOL={T,F} Semantics of formulas Given a many-sorted L-structure M and an assignment v: V→M, the function t M : [V→M]→M s defined by a term t of sort s is the function such that for every assignments v in [V→M], the value t M [v] is defined recursively as follows: 1. For a variable x of sort s, x M [v]=v s (x) 2. For a constant c, c M [v]= c M 3. Let t=f(t 1 …t n ), then (ft 1 …t n ) M [v]=f M ((t 1 ) M [v],…(t n ) M [v]) 4. Let A=P(t 1 …t n ), then (Pt 1 …t n ) M [v]=P M ((t 1 ) M [v],…(t n ) M [v]) 5. If (t 1 )M[v]=(t 2 )M[v] then ( ≒ s t 1 t 2 ) M [v]=T otherwise F 6. Let * denotes {Λ, ν→, ↔}, then (A*B) M =* M (A M,B M ) 7. ( ∀ x i :sA) M [v]=T iff A M [v[x i :=m]]=T, for all m ∈ Ms and ( ∃ x i :sA) M [v]=T iff A M [v[x i :=m]]=T, for some m ∈ Ms

9 Proof Theory of Many-sorted FOL Gentzen System G for Many-sorted Languages Without Equality Gentzen System G = for languages With Equality

10 The completeness of many-sorted logic There are two degrees of completeness: Weak completeness: Each validity is a theorem. That is, |=Φimplies |-Φ for every formula Φ. Strong completeness: Every consequence of a set of formulas is also derivable from it. That is, for every set of formulas Γ and formulas Φ, when every Γ|=Φ then also Φ can be deduced from Γ. Henkin’s theorem: Γ consistent → Γ has a model.

11 Reduction to one-sorted logic There is translation of many-sorted logic into one-sorted logic. Such a translation is described in Enderton, 1972, and you can read it for details. The essential idea to convert a many-sorted language L in to a one-sorted language L is to add domain predicate symbols D s, one for each sort, and to modify quantified formulas recursively as follows: Every formula A of the form ∀ x : sB (or ∃ : sB) is converted to the formula A’ = ∀ x(D s (x)→B’ ), where B’ is the result of converting B

12 Reference Many-Sorted Logic And its Applications, K.Meinke and J.V.Tucker Logic for Computer Science: Foundations of Automatic Theorem Proving, Jean Gallier


Download ppt "Many Sorted First-order Logic Student: Liuxing Kan Instructor: William Farmer Dept. of Computing and Software McMaster University, Hamilton, CA."

Similar presentations


Ads by Google