• 主页
  • 相册
  • 随笔
  • 目录
  • 存档
Total 244
Search AboutMe

  • 主页
  • 相册
  • 随笔
  • 目录
  • 存档

计算机数理逻辑-一阶逻辑-归结

2022-03-06

1. atom vs literal vs term

  • a: $p$
    • 在一阶逻辑下得到扩展
  • l: $p$ $\lnot{p}$
    • 注意扩展到命题逻辑中时,$P$就可以带上函数和谓词
      • In propositional calculus a literal is simply a propositional variable or its negation.
      • In predicate calculus a literal is an atomic formula or its negation, where an atomic formula is a predicate symbol applied to some terms, ${\displaystyle P(t_{1},\ldots ,t_{n})}$ with the terms recursively defined starting from constant symbols, variable symbols, and function symbols. For example, ${\displaystyle \neg Q(f(g(x),y,2),x)}$ is a negative literal with the constant symbol 2, the variable symbols x, y, the function symbols f, g, and the predicate symbol Q.
  • t: $v$ $f^{n}$ $a$
    • 注意term是变量而非字面量,如x+y,而不是p+q

2. 合一 Unification

  • Let s and t be two terms (or atoms), A unifier of s and t is a substitition σ that makes the two identical, formally
    • sσ = tσ

2.1. 最一般的合一 Most general unifier

σ is a most general unifier of s and t, denoted mgu(s, t),

  • if σ is a unifier of s and t and for any other unifier θ of s and t,
  • there is a substitution ρ such that
    • σρ = θ

2.2. Unifiers and most general unifiers, in general

  • simultaneous/ˌsaɪ.məlˈteɪ.ni.əs/ 同时的

3. unification algorithm 合一算法求解mgu

  • Input: An equational system E
  • Goal: Determine if E is unifiable, and if it is, to read off mgu
  • Output: Equational system E’ in solved form, or ⊥ (for not unifiable)
  • Perform the following transformations on the set of equations as long as any one of them is applicable:
    • 注意一定要用到不能用为止,一般结果会是左式由带有同一变量的右式表达,例如:
      • $x=y$
      • $z=f(y)$
  1. Transform t=x, where t is not a variable, to x=t. 变量换到左侧,非变量换到右边
  2. Erase the equation x=x. 消除相等式
  3. Let t′=t″ be an equation where t′, t″ are not variables. “非变量=非变量”的情况
    1. If the outermost function symbols of t′ and t″ are not identical, terminate the algorithm and report not unifiable. 如果t′和t″的最外层函数符号不一致,则终止算法,并报告不可合一
    2. Otherwise, replace the equation $f(t_1^{‘},…t_k^{‘})=f(t_1^{‘’},…t_k^{‘’})$ by the k equations $t_1^{‘}=t_1^{‘’},…t_k^{‘}=t_k^{‘’}$ . 否则替换
  4. Let x=t be an equation such that x has another occurrence in the set. 同一变量多次出现
    1. If x occurs in t and x differs from t, terminate the algorithm and report not unifiable
    2. Otherwise, transform the set by replacing all occurrences of x in other equations by t. 否则,通过将其他方程中所有出现的x替换为t来转换这个集合
    3. rule 4 also called the occurs-check

example

  • 得到mgu

3.1. $⇒_{U^-}$unification rules

  • Orientation: 方向
  • Trivial: 琐碎(可理解为无价值)
  • Disagreement/Clash:分歧/冲突
  • Decomposition:分解
  • Occur-check:出现检查(可理解为存在检查)
  • Substitution:替换

example

  • 也就是变量换成term

3.2. term equation

  • The unifiability of ${ p(f(x)),g(y),p(f(f(a))),g(z) }$ is expressed by the set of term equations
    • ${ f(x)=f(f(a)), g(y)=g(z) }$

3.3. solved form

  • A set of term equations is in solved form iff:
    • All equations are of the form $x_i =t_i$ where x i is a variable.
    • Each variable $x_i$ that appears on the left-hand side of an equation does not appear elsewhere in the set.
  • A set of equations in solved form defines a substitution:
    • ${ x_1\leftarrow{t_1},…,x_n\leftarrow{t_n} }$

也就是说必须是用term来替代变量,而不是单纯的用其他变量来rename

4. Ordered resolution with selection

4.1. Selection functions

  • A selection function is a mapping
    • $S : C\rightarrowtail{}$ (multi-)set of occurrences of negative literals in C

4.2. Maximal and strictly maximal literals

  • 特别注意第三个,要求的是there exist就可,因此类似 $P(f (x)) ∨ P (g(y))$中找最大,就得分情况讨论
    • 是否可能相等?

example

  • A literal L is (strictly) maximal wrt. a general clause C
    • iff ∃ gr. σ s.t. Lσ and $C_σ$ are ground and for all L’ in $C_σ$: $L_σ\geq{L’}$ ($L_σ>{L’}$)

5. General resolution system

Ordered resolution with selection is parameterised参数化 with:

  • a fixed total, well-founded ordering $>$ on ground atoms
  • a fixed selection function S

5.1. Resolution rule

  • Note: Renaming variables apart needs to be applied to the premises before applying resolution

5.2. Factoring rule

  • Factors即为: $C∨A$

example

  • 第四行:not P > not R
  • 注意此处是基于以上的order,否则无法进行
  • 也就是:一个CNF既可以通过herbrand theorem求解sat/unsat,也可以general resolution求解sat/unsat

注意

5.3. for propositional/ground clauses 回退到命题逻辑

5.4. Search spaces become smaller

5.5. Properties of ordered resolution with selection

example

5.6. 一个特例的讨论

  • 首先,mgu是不能rename的
  • 但在res前,要rename
    • mgu是res中的一个步骤 rename -> res(mgu)
  • 按可以res的方向进行:

you need to work out if there is a ground substitution that makes one of the literals maximsl or strictly maximal

  • sec
  • Security
  • Automated Reasoning
计算机数理逻辑-一阶逻辑-SMT
计算机数理逻辑-程序验证-协议安全分析
  1. 1. 1. atom vs literal vs term
  2. 2. 2. 合一 Unification
    1. 2.1. 2.1. 最一般的合一 Most general unifier
    2. 2.2. 2.2. Unifiers and most general unifiers, in general
  3. 3. 3. unification algorithm 合一算法求解mgu
    1. 3.1. 3.1. $⇒_{U^-}$unification rules
    2. 3.2. 3.2. term equation
    3. 3.3. 3.3. solved form
  4. 4. 4. Ordered resolution with selection
    1. 4.1. 4.1. Selection functions
    2. 4.2. 4.2. Maximal and strictly maximal literals
  5. 5. 5. General resolution system
    1. 5.1. 5.1. Resolution rule
    2. 5.2. 5.2. Factoring rule
    3. 5.3. 5.3. for propositional/ground clauses 回退到命题逻辑
    4. 5.4. 5.4. Search spaces become smaller
    5. 5.5. 5.5. Properties of ordered resolution with selection
    6. 5.6. 5.6. 一个特例的讨论
© 2024 何决云 载入天数...