Logic Specification and Z Schema 3K04 McMaster. Basic Logic Operators Logical negation ( ¬ ) Logical conjunction ( Λ or & ) Logical disjunction ( V or.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

Artificial Intelligence
Axiomatic Semantics The meaning of a program is defined by a formal system that allows one to deduce true properties of that program. No specific meaning.
Schema Operators. State We can use the language of schemas to describe the state of a system, and operations upon it. Different aspects of the state --
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
Schema Operators. State We can use the language of schemas to describe the state of a system, and operations upon it. Different aspects of the state --
1 Predicates and quantifiers Chapter 8 Formal Specification using Z.
Discrete Mathematics Math 6A Instructor: M. Welling.
Let remember from the previous lesson what is Knowledge representation
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Propositional Calculus Math Foundations of Computer Science.
Adapted from Discrete Math
Predicates and Quantifiers
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
Lecture 8 Introduction to Logic CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
The Foundations: Logic and Proofs
Propositions and Truth Tables
2009/9 1 Logic and Proofs §1.1 Introduction §1.2 Propositional Equivalences §1.3 Predicates and Quantifiers §1.4 Nested Quantifiers §1.5~7 Methods of Proofs.
Discrete Mathematics and Its Applications
Knowledge Interchange Format Michael Gruninger National Institute of Standards and Technology
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Lecture 3 [Self Study] Relational Calculus
Model-Based Specification CIS 376 Bruce R. Maxim UM-Dearborn.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
1-1 Introduction Logic programming languages, sometimes called declarative programming languages Express programs in a form of symbolic logic Use a logical.
Theory and Applications
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
ARTIFICIAL INTELLIGENCE Lecture 3 Predicate Calculus.
Course: Software Engineering ©Alessandra RussoUnit 2: States and Operations, slide number 1 States and Operations This unit aims to:  Define: State schemas.
Copyright © Cengage Learning. All rights reserved. CHAPTER 3 THE LOGIC OF QUANTIFIED STATEMENTS THE LOGIC OF QUANTIFIED STATEMENTS.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Chapter 2 The Logic of Quantified Statements. Section 2.1 Intro to Predicates & Quantified Statements.
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
Formal Methods in SE Lecture 16 Formal Methods in SE Qaisar Javaid Assistant Professor.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
13 Aug 2013 Program Verification. Proofs about Programs Why make you study logic? Why make you do proofs? Because we want to prove properties of programs.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
PREDICATE CALCULS In Propositional Calculus, each atomic symbol denotes a proposition. But there is no way to access the components of an individual assertion.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
First-Order Logic Semantics Reading: Chapter 8, , FOL Syntax and Semantics read: FOL Knowledge Engineering read: FOL.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
Simple Logic.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
Chapter 1 Propositional Logic
(State) Model-Based Approaches I Software Specification Lecture 35
Propositional Calculus: Boolean Functions and Expressions
CSNB 143 Discrete Mathematical Structures
Predicates & Quantifiers
CMSC Discrete Structures
Propositional Calculus: Boolean Functions and Expressions
The Foundations: Logic and Proofs
CHAPTER 1: LOGICS AND PROOF
Mathematics for Computer Science MIT 6.042J/18.062J
MA/CSSE 474 More Math Review Theory of Computation
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Department of Computer Science
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
George Boole English Mathematician
Predicates and Quantifiers
Presentation transcript:

Logic Specification and Z Schema 3K04 McMaster

Basic Logic Operators Logical negation ( ¬ ) Logical conjunction ( Λ or & ) Logical disjunction ( V or || ) Logical implication ( → ) Logical equality ( = or ↔ )

Logic Negation NOT p (also written as ¬p)

Logic Conjunction p AND q (also written as p ∧ q, p & q, or p·q)

Logic Disjunction p OR q (also written as p ∨ q or p + q)

Logic Implication p implies q (also written as p → q, not p or q)

Logic Equality p EQ q (also written as p = q, p ↔ q, or p ≡ q)

First-order logic While propositional logic deals with simple declarative propositions, first-order logic additionally covers predicates and quantification. Each interpretation of first-order logic includes a domain of discourse over which the quantifiers range.

Predicate A predicate resembles a function that returns either True or False. Consider the following sentences: "Socrates is a philosopher", "Plato is a philosopher". In propositional logic these are treated as two unrelated propositions, denoted for example by p and q. In first-order logic, however, the sentences can be expressed in a more parallel manner using the predicate Phil(a), which asserts that the object represented by a is a philosopher.

Quantifier - universal quantifier; - existential quantifier Let Phil(a) assert a is a philosopher and let Schol(a) assert that a is a scholar For every a, if a is a philosopher then a is a scholar. If a is a philosopher then a is a scholar.

Z notation The Z notation, is a formal specification language used for describing and modeling computing systems. It is targeted at the clear specification of computer programs and the formulation of proofs about the intended program behavior.

Z Schemas The Z schema is a graphical notation for describing – State spaces – operations

The declarations part of the schema will contains: – A list of variable declarations – References to other schemas (schema inclusion) The predicate part of a schema contains a list of predicates, separated either by semi-colons or new lines.

State Space Schemas Here is an example state-space schema, representing part of a system that records details about the phone numbers of staff. Assume that NAME is a set of names, and PHONE is a set of phone numbers.

Operation Schemas In specifying a system operation, we must consider: – The objects that are accessed by the operation; – The pre-conditions of the operation, i.e., the things that must be true for the operation to succeed; – The post-conditions, i.e., the things that will be true after the operation, if the pre-condition was satisfied before the operation.

Consider the ‘lookup’ operation: input a name, output a phone number. – This operation accesses the PhoneBook schema; – It does not change it; – It takes a single ‘input’, and produces a single output; – Pre-condition: the name is known to the database.

This illustrates the following Z conventions: – Placing the name of the schema in the declaration part ‘includes’ that schema; – ‘input’ variable names are terminated by a question mark; – ‘output’ variables are terminated by an exclamation mark; – The (Xi) symbol means that the PhoneBook schema is not changed; if we write a Δ (delta) instead, it would mean that the PhoneBook schema did change.

Add a name/phone pair to the phone book. Appending a ‘ to a variable means “the variable after the operation is performed”.

Example: Video Rental Shop

Returning a video

Removal of a video from the stock

Find a video

List all videos

Example: Sale Theater tickets

Informal specification – Theater: Tickets for the first night are only sold to friends Specification in Z

and

and are the same as

Selling tickets

Then is a schema that reports successful ticket sale.

Selling tickets, but only to friends if first night performance

Composition of Operation Schemas is equivalent to

Example: Order Invoicing

Order Invoices

State

A total operation for ordering