Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Introduction to Logic Programming with Focus on Distributed Systems, Study notes of Logic

An overview of logic and logic programming, with a particular focus on distributed systems. the basics of logic, including truth and logic axioms, as well as the concept of unification and most general unifier. It also introduces the reader to logic programming, its basic units of computation, and the role of terms, variables, and equality. The document concludes with a discussion on the relevance of logic languages for distributed systems and the concept of and-parallelism in distributed logic programming.

What you will learn

  • What is the difference between logic programming and procedural programming?
  • How is logic used in distributed systems?
  • What is the role of logic in computer science?
  • What are the basic units of computation in logic programming?
  • What is the concept of unification in logic programming?

Typology: Study notes

2021/2022

Uploaded on 09/12/2022

margoth
margoth 🇬🇧

4.4

(11)

229 documents

1 / 85

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Logic & Computation
Distributed Systems / Paradigms
Sistemi Distribuiti / Paradigmi
Andrea Omicini
andrea.omicini@unibo.it
Dipartimento di Informatica Scienza e Ingegneria (DISI)
Alma Mater Studiorum Universit`a di Bologna a Cesena
Academic Year 2016/2017
Andrea Omicini (DISI, Univ. Bologna) P1 Logic & Computation A.Y. 2016/2017 1 / 85
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55

Partial preview of the text

Download Introduction to Logic Programming with Focus on Distributed Systems and more Study notes Logic in PDF only on Docsity!

Logic & Computation

Distributed Systems / Paradigms Sistemi Distribuiti / Paradigmi

Andrea Omicini andrea.omicini@unibo.it

Dipartimento di Informatica – Scienza e Ingegneria (DISI) Alma Mater Studiorum – Universit`a di Bologna a Cesena

Academic Year 2016/

Outline

(^1) Logic

(^2) Logic Programming

3 Distributed Logic Programming

What is Logic?

Logic

http://www.britannica.com/topic/logic Logic, the study of correct reasoning, especially as it involves the drawing of inferences.

logic studies the way we draw conclusions and express ourselves, and deals with how to formalise it [Metakides and Nerode, 1996a] it dates back to Aristotle, for whom logic is the instrument for human knowledge [Rijk, 2002]

Computational Logic

Logic in Computer Science

computational logic (CL) [Lloyd, 1990] is logic in computer science it concerns all uses of logic in computer science: to compute, to represent computation, to reason about computation it is rooted in logic, applied math, artificial intelligence, computer science

Logic & Math II

The rise of mathematical logic

starting form a paradox in Cantor’s theory of numbers, Russell’s paradox (the set of all sets that do not belong to themselves) exposed the logical inconsistencies at the foundations of mathematics this made clear that only a rigorous formalisation of mathematics could lead to well-founded mathematical reasoning and theories around 1920, David Hilbert’s program aimed at addressing the issue—to be soon undermined by G¨odel’s Incompleteness Theorems [G¨odel, 1931] the acme of those efforts resulted in the “Principia Mathematica” [Whitehead and Russell, 1927], a complete logic formalisation of all mathematics, finally treated as a whole axiomatic system

Truth I

Syntax vs. semantics: examples

“the sum of numbers two and one is three” is a true proposition in any formalisation of arithmetics, whatever symbols we use—the semantic side of truth if “the Snark was a Boojum” [Carroll, 1876] then “something is a Boojum” is a true proposition whatever the meaning of the sentence—the syntax side of truth

Truth III

Interpretation and logic entailment

Alfred Tarski [Tarski and Tarski, 1994] formalised the notion of logical interpretation as the relation between the symbols (syntax) and the elements of the domain of discourse (semantics) he defined logical entailment (or, logical consequence) precisely: when a conclusion is true in every interpretation making all premises true, then premises logically entail the conclusion—or, the conclusion is a logical consequence of the premises

Truth IV

Interpretation and logic entailment

after Tarski’s work, logic is typically discussed as a two-sided story [Levesque, 2012] a syntactic side involving axioms and rules of inference—sometimes called a proof theory a semantic side involving interpretations and truth—sometimes called a model theory with logical soundness and completeness theorems relating the two sides

Truth VI

logic axioms

no interpretation interpretation

syntax

(symbols)

semantics

(meanings)

theorem proof logic entailment

soundness

completeness

Computation vs. Deduction I

The difference between computation and deduction [Pfenning, 2007]

To compute we start from a given expression and, according to a fixed set of rules (the program) generate a result. For example, 15 + 26 → (1 + 2 + 1)1 → (3 + 1)1 → 41. To deduce we start from a conjecture and, according to a fixed set of rules (the axioms and inference rules), try to construct a proof of the conjecture. So computation is mechanical and requires no ingenuity, while deduction is a creative process. For example, an^ + bn^6 = cn^ for n > 2 ,... , 357 years of hard work... , QED.

Computation vs. Deduction III

Yet, somehow computation deduction [Pfenning, 2007]

(^1) computation can be seen as a limited form of deduction since it establishes theorems—e.g., 15 + 26 = 41 is both the result of a computation, and a theorem of arithmetic (^2) deduction can be considered a form of computation if we fix a strategy for proof search, removing the guesswork (and the possibility of employing ingenuity) from the deductive process

This latter idea is the foundation of logic programming. Logic program computation proceeds by proof search according to a fixed strategy. By knowing what this strategy is, we can implement particular algorithms in logic, and execute the algorithms by proof search.

Deduction I

Judgements [Martin-L¨of, 1996]

a judgement is an object of knowledge—knowing a judgement comes from the evidence we have for it the most common judgement is A true—that is, given a proposition A, A is true ! most of logic programming deals with truth of propositions other judgements are A false – that is, A is false – for true negation A true at t – that is, A is true at time t – the subject of temporal logic K knows A – that is, K knows that A is true – the subject of epistemic logic

Deduction III

Inference chain

if we know J 1 ,... Jn and J^1 ,..., J JnR then we can infer J how do we know, say, J 1? we may know J 1 , 1 ,... J 1 ,n and J^1 ,^1 ,..., J 1 J^1 ,nR 1 , then infer J 1 thus we may build an inference chain to prove J—if possible

Proof I

Proof tree

given the structure of a deduction, the data structure covering all the possible inference chains for a judgement J is a tree—a proof tree whose root is the conclusion J whose edges are deductions labelled by an inference rule where premises are child nodes, conclusions are parent nodes

... J 1 , 1

R 1 , 1 ,... ,

J 1 ,n 1

R 1 ,n 1

J 1

R 1...

Jn, 1

Rn, 1 ,... ,

Jn,nn

Rn,nn

Jn

Rn

J

R

J is the root of the tree J 1 ,... Jn are nodes of the tree