zoukankan      html  css  js  c++  java
  • A Intro Snippet for Logic & Propositional Logic

    Written with StackEdit.

    Materials: AIMA, Ch. 7

    Basics for Logic

    Syntax vs. Semantic

    Syntax : well formed representation

    Semantic : sentences' specific meaning in a "possible world"

    possible world: "model", such as "a world where x=1 and y=2".

    Satisfaction vs. Entailment

    Satisfaction : if sentence (alpha) is true in model (m) , we say :

    • (m) satisfies (alpha),
    • (m) is a model of (alpha),
    • (M(alpha)={m|m ext{ is a model of }alpha}).

    e.g. "(x=2, y=2)" is a model of "(x+y=4)".

    Entailment : A sentence follows logically from another sentence.

    • (alphavDasheta Leftrightarrow M(alpha)subseteq M(eta)), which means (alpha) entails (beta) .

    e.g. (x=0) entails (xy=0) .

    Inference vs. Entailment

    We use INFERENCE to find ENTAILMENT .

    If we can use inference algorithm (i) to derive (alpha) from (KB) , we say:

    • (KBvdash_ialpha), as (i) derives (alpha) from (KB) .

    Soundness vs. Completeness

    Soundness : An inference algorithm that derives only entailed sentences is called sound .

    Model-checking ( To prove (KBvdash_{mc}alpha), check every model to prove (M(alpha)subseteq M(KB)) ) is a sound algorithm when possible.

    e.g.: only find exist needles in a haystack.

    Completeness : An inference algorithm that can derive any sentence that is entailed is called complete .

    e.g.: find every exists needle in a haystack.

    Representation vs. Real World

    Corresponding relation between "x entails x" in logical representation and xx follows xx in real world .

    Grounding issues. "Sensors" guarantees (KB) is true in Real World.

    Propositional Logic

    Syntax

    • Atomic sentences: capitalized letters
      • True/False
    • Logical connectives: connect atomic sentences to make complex sentences
      • ( eg) neg , negation
      • (land) land , conjuction
      • (lor) lor , disjunction
      • (Rightarrow) Rightarrow , imply
      • (Leftrightarrow) Leftrightarrow IFF , biconditional
        • also (equiv) equiv

    Semantic

    Rules for Atomic sentences are easy:
    True is true in every model and False is false in every model.
    • The truth value of every other proposition symbol must be specified directly in the model.

    For complex sentences, we have five rules, which hold for any subsentences (P) and (Q) in any model m (here “iff” means “if and only if”):
    ( eg P) is true iff (P) is false in (m).
    (P land Q) is true iff both (P) and (Q) are true in (m).
    (P lor Q) is true iff either (P) or (Q) is true in (m).
    • * (P Rightarrow Q) is true unless (P) is true and (Q) is false in (m).
    (P Leftrightarrow Q) is true iff (P) and (Q) are both true or both false in (m).

    A tricky point: (PRightarrow Q) is true in model (M) EXCEPT (P) is true but (Q) is false.

    You can refer to this: ((PRightarrow Q) Leftrightarrow ( eg P lor Q))

    btw, Truth Table solves all.

  • 相关阅读:
    [职场]最近聊到30岁以上的程序员,该何去何从了?你有啥想法?
    想跳槽涨薪,想进大厂,如何准备面试呢?
    [面试分享]想跳槽涨薪,想进大厂,如何准备面试呢?
    缓存穿透、缓存并发、缓存雪崩、缓存抖动、热点缓存、缓存双写一致性等问题...
    8天玩转并行开发——第八天 用VS性能向导解剖你的程序
    8天入门wpf—— 第一天 基础概念介绍
    8天玩转并行开发——第六天 异步编程模型
    8天入门wpf—— 第八天 最后的补充
    6天通吃树结构—— 第二天 平衡二叉树
    8天入门wpf—— 第七天 画刷
  • 原文地址:https://www.cnblogs.com/ria2020/p/13819599.html
Copyright © 2011-2022 走看看