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.

  • 相关阅读:
    Collections之sort、reverse
    网页小实验——在平面空间建立大量“可思考的”对象
    3D网页小实验——将txt配置文本转化为3D陈列室
    原生JavaScript实现一种日历
    JavaScript实现竖向滚动条的一种思路
    一个原生JavaScript动画库原型
    html小工具——文章注释编辑器
    基于Babylon.js编写宇宙飞船模拟程序1——程序基础结构、物理引擎使用、三维罗盘
    WebGL场景的两种地面构造方法
    基于Babylon.js编写简单的骨骼动画生成器
  • 原文地址:https://www.cnblogs.com/ria2020/p/13819599.html
Copyright © 2011-2022 走看看