Program Logic Formulation Introduction
Program Logic Formulation Introduction
{ IT10
Two girls were born to the same
mother, on the same day, at the same
time, in the same month and year and
yet they’re not twins. How can this be?
Who killed #9?
What is a Program?
Noun:
A set of related measures or activities with a particular long-term
aim.
A series of coded software instructions to control the operation of a
The systematic study of the form of valid inference, and the most
general laws of truth.
A valid inference is one where there is a specific relation of logical
Syntax: the rules about how to form formulas; this is the rules about
how to form formulas; this is usually the easy part of a logic.
usually the easy part of a logic.
Semantics: about the meaning carried by the formulas, about the
mother(kathy,lily)
mother(lily,bill)
Father(ken,karen)
Father(john,lily).
Mother(kathy,lily).
Mother(lily,bill).
Father(ken,karen).
Ask Prolog to do something
Example Query:
?-sum([3,5,2]),Q)
Prolog should return the answer:
Q = 10.
What is Formulation?
System Software
A software that designed to help programmers or to control the
computer system.
Systems Analysis
Design Method.
System Definition
• Provides another
way of defining a
system – as a
collection of inputs,
outputs, and
processor activities
with feedback, a
boundary, and an
environment.
System Analyst
• A person trained in the analysis of complex business system, which
typically involve a computer-based information system.
Systems Development Life Cycle (SDLC)
1. Design documentation
• Contains data flow diagrams; functional, performance, &
data storage requirements; & management reports.
2. Programming documentation
• Used by technical people to define the architecture of an
information system.
3. User documentation
• Consists of training, operations, & reference manuals that
describe how to use the system.
Installation Phase
• Your last good ping-pong ball fell down into a narrow metal
pipe down imbedded in a concrete one foot deep. How can
you get it out undamaged, if all tools you have are your
tennis paddle, shoe-laces, and your plastic water bottle,
which does not fit into the pipe? What will you do?
#3 A Man in an Elevator
• A man who lives on the tenth floor takes the elevator down
to the first floor every morning and goes to work. In the
evening, when he comes back; on a rainy day, or if there
are other people in the elevator, he goes to his floor directly.
Otherwise, he goes to seventh floor and walks up three
flights of stairs to his apartment. Can you explain why?
#4 The Ball
• How can you throw a ball as hard as you can and have it
come back to you, even if it doesn’t bounce off anything?
There is nothing attached to it, and no one else catches or
throws it back to you?
#5 Where is the Father?
• You are in a dark room. You have one match left. Which do
you light first? The newspaper, the candle or the lamp?
#10 Number Series
• January = 1017
• February = 628
• March = 1335
• April = 145
• May = 1353
• June = 1064
• July = 1074
• August = 186
• September = 1999
• THEN
• October = ???
• November = ???
• December = ???