CSC 339 Test 3 Ch.16

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/43

encourage image

There's no tags or description

Looks like no tags are added yet.

44 Terms

1
New cards

Logic programming languages

Logic programming languages use programs expressed in symbolic logic

2
New cards

Logical inferencing process

is used to generate results

3
New cards

Logical programming

is declarative instead of procedural

Desired results are specified, not the method for producing them

4
New cards

Proposition

A proposition is a logical statement that may or may not be true

5
New cards

Objects in propositions are represented by _____________

simple terms: constants or variables

6
New cards

Constant

• Constant - A symbol that represents an object

7
New cards

Variable

• Variable - A symbol that can represent different objects at different times

8
New cards

Atomic Propositions

• Atomic propositions consist of compound terms

9
New cards

Compound terms

• Compound term - one element of a mathematical relation written in a form that

has the appearance of a mathematical function

  • Functor - function symbol that names the relationship

  • Ordered list of parameters (tuple)

  • student(jim)

  • like(Bob, MacOS)


10
New cards

Symbolic logic

can be used for the three basic needs of formal logic

• Express propositions

• Express relationship between propositions

• Describe how new propositions can be inferred from other propositions

11
New cards

The form used for logic programming

The form used for logic programming is first-order predicate calculus

12
New cards

What can propositions be?

• Can be a fact or a query

  • Fact is assumed to be true

  • Query is a proposition whose truth is to be determined


13
New cards

Compound Proposition

A compound proposition can have two or more atomic propositions that are connected by operators

14
New cards

Clausal form

• As defined, there are too many ways to state the same thing

• Need a standard form for propositions

• This is the clausal form

  • B1 ∪ B2 ∪ … ∪ Bn āŠ‚ A1 ∩ A2 ∩ .. ∩ Am

  • This means that if all of the As are true, then at least one B is true

  • Antecedent - right side

  • Consequent - left side

• likes(bob, tuna) āŠ‚ likes(bob, fish) ∩ fish(tuna)

15
New cards

Propositions are used to discover…

New theorems that can be inferred from known axioms and theorems

16
New cards

Resolution

an inference principle that allows inferred propositions to be computed from given propositions

17
New cards

Unification

Unification - finding values for variables in propositions that allows

the matching process to succeed

18
New cards

Instantiation

Instantiation - assigning temporary values to variables to allow

unification to succeed

After instantiating a variable with a value, if matching fails, we may

need to backtrack and instantiate with a different value

19
New cards

Refutation complete

Refutation complete - Given a set of inconsistent propositions, resolution can prove them to be inconsistent

20
New cards

Proof by contradiction

Assume the negative of a theorem, then prove it true by finding an

inconsistency

21
New cards

Theorem proving is the…

basis of logic programming

• Must use the restricted form for propositions

• Horn clause

  • Headed - single atomic proposition on the left side

  • Headless - empty left side (facts)


22
New cards

Declarative semantics

• There is a simple way to determine the meaning of each statement

• Simpler than the semantics of imperative languages

23
New cards

Programming is…

• Nonprocedural, programs do not state how a result is to be computed, but rather

the form of the result

24
New cards

The Basic Elements of Prolog

Term, constant, atom, variable, Instantiation, Structure

25
New cards

Term

Term - a constant, variable, or structure

26
New cards

Constant

Constant - an atom or an integer

27
New cards

Atom

Atom - symbolic value of Prolog

Consists of either

• String of letters, digits, and underscores starting with a lowercase letter

• String of printable ASCII characters delimited by apostrophes

28
New cards

Variable

Variable - any string of letters, digits, and underscores beginning with

an uppercase letter

29
New cards

Instantiation

binding of a variable to a value

• Lasts only as long as it takes to satisfy one complete goal

30
New cards

Structure

Structure - represents atomic proposition

• functor (parameter list)

31
New cards

Fact statements

Used for the hypothesis

Headless horn clauses

• female(jill)

• male(bill)

• father(bill, jill)

32
New cards

Rule statements

• Used for the hypothesis

• Headed Horn clause

• Right side: antecedent (if part)

  • May be a single term or conjunction

• Left side: consequent (then part)

  • Must be a single term

• Conjunction - multiple terms separated by logical AND operations

33
New cards

Goal statements

• For theorem proving, theorem is in the form of proposition that we want the system to prove or disprove - goal statement

• Same format as headless Horn

  • man(fred)

    • System will respond with yes or no.

  • father(X, mike)

    • System will try to find a value for X for which the theorem is true


34
New cards

Inferencing process of Prolog

• Queries are called goals

• If a goal is a compound proposition, each of the facts is a subgoal

• To prove a goal is true, must find a chain of inference rules and/or facts

• Process of proving a subgoal is called matching, satisfying, or resolution

35
New cards

Approaches to inferencing process of Prolog


• Bottom-up resolution, forward chaining

  • Begin with the facts and rules of a database and attempt to find a sequence that leads to a goal. Works well with a large set of possible answers.


36
New cards

Matching

is the process of proving a proposition

37
New cards

Satisfying the subgoal

Proving a subgoal is called satisfying the subgoal

38
New cards

Bottom-up resolution, forward chaining

Begin with the facts and rules of a database and attempt to find a sequence that

leads to a goal. Works well with a large set of possible answers.

39
New cards

Top-down resolution, backward chaining

Begin with the goal and attempt to find a sequence that leads to set of facts

in database. Works well with a small set of possibly correct answers.

40
New cards

Prolog implementations use

backward chaining

41
New cards

When a goal has more than one subgoal

• Depth-first search: find a complete proof for the first subgoal before working on others

• Breadth-first search: work on all subgoals in parallel

• Prolog uses depth-first search

42
New cards

Backtracking

• With a goal with multiple subgoals, if a subgoal fails truth, reconsider a previous subgoal to find an alternative solution

• Begin where the previous search left off

• Can take lots of time and space because it may find all possible proofs to every subgoal

43
New cards

Simple Arithmetic

• Integer variables and arithmetic is supported

• is operator (not an assignment)

  • • A is B / 17 + C - LEGAL

  • • Sum is Sum + Number - ILLEGAL!


44
New cards

Trace