Upgrade to Pro — share decks privately, control downloads, hide ads and more …

数理議論学に基づく仕様書の不整合解消支援

 数理議論学に基づく仕様書の不整合解消支援

toshinoritakai

May 14, 2019
Tweet

More Decks by toshinoritakai

Other Decks in Technology

Transcript

  1. ⾃⼰紹介 • 名前:岡本 圭史(おかもと けいし) • 所属:仙台⾼等専⾨学校 • 元産総研の岡本さん,IPA委員の岡本さんと呼ばれることも •

    専⾨分野:計算機科学,形式⼿法,数理論理学 • STAMP/STPAの話をする⼈として認識されることも • IJCAIに採択されてから,⼈⼯知能系の学会の案内が⼤量に来ることも
  2. 背景:仕様書の品質改善 • 仕様書の品質 • 開発⼯程中で混⼊する⽋陥の70%が実装⼯程より前の⼯程で混⼊ ⇒良い品質の仕様書作成は重要 • 仕様書の品質改善は⼤変コストのかかる作業 • 形式仕様記述による仕様書の品質改善

    • 形式仕様記述:数理論理学に基づく厳密な⽂法+意味論 • 構⽂的不整合(論理的⽭盾)を⾃動検知 • ¬AとAは論理的⽭盾 • 意味的不整合を検知可能(意味的不整合の定義の追加記述が必要) • 「⿃は⾶ぶ」と「カラスは⾶ばない」が意味的不整合あることを 検知するためには,「カラスは⿃である」ことを知っていなければならない.
  3. 背景:形式仕様記述の課題 • 形式仕様記述の課題 • 論理式で仕様を記述するのは⼤変(要:時間,専⾨知識) • 仕様書中の⽂の内容を詳細に記述する必要がある • 記述量が増える為,計算機が処理できなくなりがち •

    論理的⽭盾以外の不整合を簡潔に扱えない • 論理的⽭盾以外の不整合を扱うためには,追加の記述が必要 • 例:論理的に⽭盾はしないが,より⾼い安全制約を採⽤したい • ⽂Aと⽂Bが不整合なときにどちらを修正すべきか? • どちらを修正すべきかの判断は⼈間
  4. 数理議論学 • 数理議論学 • 「ある主張の根拠をどのように正当化するのか」という問題について, 社会学,⾔語学,⼼理学,論理学,弁証法など多くの分野で学際的に 研究されている学問分野 • 数理的⽅法に基づく議論学 •

    議論フレームワーク(Argumentation Framework, Dung[1995]) • 有向グラフ:A「論証」=頂点,R「攻撃関係」=有向辺 • 外延(extension):Aの整合的な部分集合 数理議論学,若⽊利⼦,新⽥克⼰,東京電機⼤学出版(2017)
  5. アイディア 数理議論学に基づく不整合解消⽀援 • AF=有向グラフ • 「論証」=頂点,(反論を表す)「攻撃関係」=有向辺 • 論証=仕様書の基本記述 • ⽂,図,形式仕様の論理式等

    • 攻撃関係=仕様書中の不整合 • ⽂Aが⽂Bと⽭盾する • ⽂Aはより⽂Bより⾼い安全性を要求 • 外延=採⽤すべき基本記述集合の候補 • 外延に属する論証から攻撃される論証は修正されるべき記述 図1:数理議論学の議論フレームワークの例 ({a,d}が外延の⼀つ)
  6. 提案 • 数理議論学+数理論理学に基づく仕様書の不整合解消⽀援 • 数理論理学と数理議論学の使い分け • 論理式を書かなくてもよい • 議論フレームワーク(議)として仕様書を定式化 •

    ⼤規模な仕様書の不整合解消を⽀援 • 攻撃関係(議)として仕様書中の不整合を抽象化 • SAT/SMTソルバ(論)を⽤いて外延を計算 • 多少規模が⼤きくなっても計算機処理可能 • ⽭盾を含む広義な不整合の解消を⽀援 • 議論フレームワーク(議)として,広義不整合も簡潔に扱える • 外延(議)を⽤いて,不整合解消の判断材料を提⽰
  7. 数理議論学を仕様書の 不整合解消⽀援に⽤いることの効果1 • 効果A)多様な不整合性と暗黙知の定式化 • 数理議論学では多様な不整合な記述(ある主張への反論)を許す • 複数の仕様記述者による記述:反論が含まれる記述達の中から正当な主張を選択 • 効果A-1)多様な不整合性の定式化:

    • 数理議論学の攻撃関係は,数理論理学の⽭盾と⽐較して,多様な不整合性を定義可能 • ⽂1「⽔温センサの値が90度以上ならば,加熱モードから保温モードへ移⾏せよ」 • ⽂2「⽔温センサの値が95度以上ならば,加熱モードから保温モードへ移⾏せよ」 • 数理議論学:⽂1は⽂2を攻撃,数理論理学:⽂1と⽂2は⽭盾しない • 効果A-2)暗黙知の定式化: • 拡充的推論(インダクション,アブダクション,アナロジー等)が扱いやすく,暗黙知を定 式化可能 • 「AゆえにB」と仕様書に記述されていても, • 「演繹的(論理的)にA➝Bが証明できる」の意味?⇒そうとは限らない • 「帰納的(経験的)にAのときにはBとしていた」の意味?⇒実はこちらの意味 • 「AゆえにB」を⼀論証(AFのノード)とすることで,(演繹的証明は無いが)経験的に有⽤ な知識(暗黙知)「AゆえにB」を不整合解消の検討対象の中に含められる.
  8. 今後の予定 • 外延列挙法の提案 • AFから外延を計算する⼿法をSMT問題の拡張として定式化 • SMTソルバを拡張した外延計算ツールを試作 • AF構築法の提案 •

    仕様書からAFを構築する⼿法を提案 • 議論マイニングの基礎理論を構築し,AF構築法を提案 • 具体的には,数理議論学が与える議論的推論を特徴づけるベイズ的⽣ 成モデルを形式化し,統計的⾃然⾔語処理に基づく議論マイニングの 既存⼿法と組み合わせて⽤いる予定である.数理議論学に基づく⽅法 と統計的⾃然⾔語処理に基づく⽅法の最適な組合せを実験的に検証す る予定である. • 不整合解消⽀援⼿法の提案とツール試作・評価
  9. 概要 • SMTソルバ+αを⽤いてDungの外延を列挙する⽅法を提案 • ⼤規模な議論フレームワークに対し外延を計算する⼿法は有⽤ • 外延は議論構造を明らかにする有⽤な情報を与える • 安定外延と完全外延 •

    ⼀階述語論理式で定義可能 • ⇒SMTソルバで(素朴に)計算可能 • 選好外延と基礎外延 • ある種の性質を満たす極⼤(極⼩)集合として定義される • ⇒極⼤(極⼩)集合を求める機能を追加したSMTソルバで計算可能 • 計算上の⼯夫 • 論理的同値でSMTソルバが解きやすい形式に変換(Skolem化)
  10. 数理議論学:外延 • Dungの議論意味論は以下の四外延で定義される: • 外延(Extension,拡張):AF (A,R)のAのある条件を満たす部分集合 • 安定外延(Stable extension) •

    Sは無衝突(conflict-free),かつA-Sに属する任意の論証を攻撃する • 選好外延(Preferred extensions) • Sは包含関係に関して極⼤な許容可能(admissible)集合 • 完全外延(Complete extensions) • Sは許容可能かつSに関して受理可能な論証はすべてEの要素 • 基礎外延(Grounded extension) • Sは包含関係に関して極⼩な完全集合 数理議論学,若⽊利⼦,新⽥克⼰,東京電機⼤学出版(2017) 各外延の定義は後程細かく紹介します.
  11. Example: Dungʼs Extensions[5] • A = {a,b,c,d,e} and R =

    {(a,b),(c,b),(c.d),(d,c),(d,e),(e,e)}. • Stable extension(s): {a,d} • Preferred extensions: {a,c}, {a,d} • Complete extensions: {a,c}, {a,d}, {a} • Grounded extension: {a}
  12. ⽬的:外延を計算する • SAT/SMTソルバで外延計算は可能か? • 外延の制約(定義)を記述できれば,ソルバが制約を満たす集合を出⼒ • 事実:議論フレームワーク(A,R)はFOの枠組みで定式化可能 • (A,R)は有向グラフ =

    集合+⼆項関係 • ⽅針:外延 S (Aの部分集合) = 未解釈⼀変数述語記号 S(x) • 外延を求める=SMT問題を解く • 問題:各種外延はFO定義(記述)可能か? • FO定義可能な外延:安定外延,完全外延 • FO定義可能でないがSMT+αで計算可能な外延:選好外延,基礎外延
  13. 外延の定式化1 • 安定 S is a subset s.t. • S

    is conflict-free and, • for each a∈A, if a∉S then there exists b∈S such that R(b,a) holds • 安定外延(の条件)は⼀階述語論理式で記述可能か? • Yes • 選好 is a maximal subset s.t. • S is admissible (FO-definable) • 極⼤な部分集合をどう定義するか?
  14. 外延の定式化2 • 選好外延 S of (A, R) • is a

    maximal subset in {Sʼ ⊆ A | Sʼ is admissible} • a hard constraint that “S is admissible" and • soft constraints that “S is maximal under the hard constraint” • 基本的なSMT問題 • + hard/soft constraints • + maximal/minimal subset of A • + enumeration [Liffiton13] [Liffiton13] Enumerating Infeasibility: Finding Multiple MUSes Quickly, Mark H. Liffiton and Ammar Malik, in Proc. 10th International Conference on Integration of Artificial Intelligence (AI) and Operations Research (OR) techniques in Constraint Programming (CPAIOR-2013), 160-175, 2013
  15. Definition: Satisfiability [2] 1. A first-order formula φ is satisfiable

    if there is a model of φ. A first-order formula φ is unsatisfiable if it is not satisfiable. 2. A set C of first-order formulas is satisfiable if there is a model of the conjunction of all the first-order formula in C, namely a model of C. A set C of first-order formulas is unsatisfiable if it is not satisfiable.
  16. Definition: MSS and Partial MSS [6] • Let C be

    a set of constraints. A satisfiable subset S of C is a maximal satisfiable subset (MSS) if ∀c∈C-S: S∪{c} is unsatisfiable. • Let C be a set of constraints in which some constraints are declared to be hard and the rest are declared to be soft. A satisfiable subset S of C is a partial maximal satisfiable subset (Partial MSS) if S is a maximal satisfiable subset and includes all the hard constraints. • A hard constraint is a constraint that must be satisfied. • A soft constraint is a constraint that should be satisfied.
  17. 例: Partial MSS • Hard Constraints: H = {x>0, x<20}

    • Soft Constraints: S = {x>10, x<10, x>15, x<15} • ⇒ the set H∪S is not satisfiable • ⇒ H∪{x>10}, H∪{x<10}, H∪{x>15}, H∪{x<15}, H∪{x>10, x<15}, H∪{x>10, x>15}, H∪{x<10, x<15} are partial satisfiable subsets of H∪S. • ⇒ H∪{x>10, x<15}, H∪{x>10, x>15}, H∪{x<10, x<15} are partial maximal satisfiable subsets of H∪S.
  18. Note: Partial MaxSAT Problem • a Partial MaxSAT problem[2] ≠

    a Partial MSSEx problem. • Because the former extract a solution of maximum size while the later may extract a solution which is not a maximum size but a maximal with respect to the set inclusion. • Definition: Partial MaxSAT Problem • The Partial MaxSAT problem for a set of FO-formulas, in which some FO-formulas are declared to be hard and the rest are declared to be soft, is the problem of finding an interpretation that satisfies all the hard constraints and the maximum number of soft constraints.
  19. Definition: Argument Framework [1,5] • An argument framework (A, R)

    is a pair of a set A of arguments and a binary relation R on A. • R represents an attack relation between arguments, namely (a, b)∈R (or R(a,b) holds) means that an argument a attacks an argument b. • We say that a subset S of A attacks an argument a if there is an argument b∈S such that (b,a)∈R
  20. Example: Dungʼs Extensions[5] • Let (A; R) be the argument

    framework where A = {a,b,c,d,e} and R = {(a,b),(c,b),(c.d),(d,c),(d,e),(e,e)}. • Stable extension(s): {a,d} • Preferred extensions: {a,c}, {a,d} • Complete extensions: {a,c}, {a,d}, {a} • Grounded extension: {a}
  21. Definition: Conflict-free [1,5] • Def: A subset S of A

    is conflict-free if ¬∃a,b∈S (a,b)∈R. • CF(S): ∀x∀y((S(x) ∧ S(y)) -> ¬R(x,y)) • e.g. {a, c}, {a},…
  22. Definition: Stable Extension [1,5] • Def: A subset S of

    A is a stable extension if it is conflict-free and ∀a∈A (a∉S -> ∃b∈S (b,a)∈R) • ∀a∈A (a∉S -> ∃b∈S (b,a)∈R) • ⇔∀x(¬S(x) -> ∃y(S(y) ∧ R(y, x))) • ⇔∀x∃y(¬S(x) -> (S(y) ∧ R(y, x))) (SE(S)) • ⇔∀x(¬S(x) -> (S(f1(x)) ∧ R(f1(x), x))) (SE(S,f1)) • a Skolem function f1(x) Stable extension(s): {a,d}
  23. Definition: Defend [5] • Def: An argument a is defended

    by a set S ⊆ A (or S defends a) if for any argument b∈A, if b attacks a then S attacks b. • We say that “a is defended by S" instead of saying that “a is acceptable with respect to S" in [1]. • “x is defended by S" • ⇔∀y (R(y, x) -> ∃z (S(z) ∧ R(z, y))) • ⇔∀y∃z(R(y, x) -> (S(z) ∧ R(z, y))) (D(S, x)) {a,c} defends c
  24. Definition: Preferred Extension [1, 5] • Def: A subset S

    of A is admissible if it is conflict-free and, for each argument a∈A, if a∈S then a is defended by S. • for each argument a∈A, if a∈S then a is defended by S ⇔∀x(S(x) -> D(S,x)) ⇔∀x,y∈A[(S(x)∧R(y, x))->(S(f2(x,y))∧R(f2(x,y),y))] (AS(S,f2)) • A subset S of A is a preferred extension if it is a maximal admissible subset of (A, R). Preferred extensions: {a,c}, {a,d}
  25. Definition: Complete Extension [1, 5] • A subset S of

    A is a complete extension if it is an admissible subset of (A, R) and, for each argument a∈A, if a is defended by S then a∈S. • for each argument a∈A, if a is defended by S then a∈S ⇔∀x∈A{(D(S, x)) -> S(x)} ⇔∀x∈A∃y∈A∀z∈A[{(R(y,x)->(S(z)∧R(z,y))}->S(x)] (CE(S)) • AS(S,f2)∧CE(S) ≣ ∀x∈A∀z∈A[{(R(f3(x),x)->(S(z)∧R(z,f3(x)))}->S(x)] (CE(S,f3)) • a complete extension of (A,R) is a subset of A satisfying a [hard] constraint AS(S,f2)∧CE(S,f3).
  26. Example: Dungʼs Extensions[5] • Complete extensions: {a,c}, {a,d}, {a} •

    A subset S of A is a complete extension if it is an admissible subset of (A, R) and, for each argument a∈A, if a is defended by S then a∈S. • {a,c} defend a and c • {a,c} does not defend d
  27. Definition: Grounded Extension [5] • A subset S of A

    is the grounded extension if it is the least complete extension of (A,R). • the grounded extension of (A,R) is a minimal subset S of A satisfying a [hard] constraint AS(S,f2)∧CE(S,f3). Grounded extension: {a} {a,c} and {a,d} are not grounded extensions.
  28. 外延列挙= Partial MSSEn問題を解く • 以下の⼆種類の制約を満たす極⼤(極⼩)な集合を列挙 • Hard Constraints • 議論フレームワーク(A,R)の情報

    • an enumeration of A + the set {R(a,b) | (a,b)∈R} • Sが満たすべき外延の条件の⼀部(SE(S)等) • Soft Constraints • S is a maximal (minimal) satisfiable subset w.r.t HC • maximal satisfiable subsets: S(x1), S(x2), … • minimal satisfiable subset:¬S(x1),¬S(x2),… • satisfiable subset: S(x1),S(x2),…,¬S(x1),¬S(x2),… • これで解く必要は無いが…
  29. 例:選好外延の列挙 • 選好外延 S:CF(S)∧AS(S,f2)を満たすAの極⼤部分集合 • Hard Constraints: CF(S)∧AS(S,f2), G(A,R) and

    • Soft Constraints: {S(a),S(b),…,S(e)} where A = {a,b,c,d,e} • ⇒ ソルバの(⼀つの)出⼒ {S(a), S(d)} • ⇒ S = {a,d}はCF(S)∧AS(S,f2)を満たすAの極⼤部分集合 • ⇒ {a,d}は極⼤なadmissible subset of A • ⇒ {a,d}は選好外延 Preferred extensions: {a,c}, {a,d}
  30. Example: Dungʼs Extensions[5] • Stable extension(s): {a,d} • Preferred extensions:

    {a,c}, {a,d} • Complete extensions: {a,c}, {a,d}, {a} • Grounded extension: {a} • これらを正しく出⼒できるか?
  31. Result: Stable Extension • HC=CF(S)∧SE(S,f1) • SC=T,F i.e. constraints of

    the form S(x), ¬S(x) # MUS [S(c)] # MUS [Not(S(d))] # MUS [Not(S(a))] # MSS [S(a), Not(S(b)), Not(S(c)), S(d), Not(S(e))] # means that {a,d} is a SE.
  32. Result: Preferred Extension • a maximal admissible set • HC=CF(S)∧AS(S,f2)

    • SC=T i.e., soft constraints are constraints of the form S(x) # MUS [S(e)] # MUS [S(b)] # MUS [S(c), S(d)] # MSS [S(a), S(d)] # means that {a,d} is a preferred extension. # MSS [S(a), S(c)] # means that {a,c} is a preferred extension.
  33. Results: Complete Extension • HC=AS(S,f2)∧CE(S) • SC=T,F # MUS [S(e)]

    # MUS [Not(S(a))] # MUS [S(b)] # MUS [S(c), Not(S(c))] # MUS [S(d), Not(S(d))] # MUS [S(c), S(d)] # MSS [S(a), Not(S(b)), Not(S(c)), S(d), Not(S(e))] # means that {a,d} is a CE. # MSS [S(a), Not(S(b)), Not(S(c)), Not(S(d)), Not(S(e))] # means that {a} is a CE. # MSS [S(a), Not(S(b)), S(c), Not(S(d)), Not(S(e))] # means that {a,c} is a CE.
  34. Results: the Grounded Extension • the least complete extension (=a

    minimal complete extension) • HC=AS(S,f2)∧CS(S,f3) • SC=F i.e., constraints of the form ¬S(x) # MUS [Not(S(a))] # MSS [Not(S(b)), Not(S(c)), Not(S(d)), Not(S(e))] # means that {a} is the GE.
  35. Experimental Result 1 • |Nodes|=100, Rnd(R)=0.5,without loops • Preferred Extension

    = Conflict Free + Admissible + Maximal # Experimental Result # MSS [S(n37), S(n21), S(n25), S(n30), S(n74), S(n97)] # MSS [S(n20), S(n49), S(n87), S(n94), S(n1)] # MSS [S(n3), S(n35), S(n53), S(n58)] # MSS [S(n53), S(n80), S(n20), S(n33), S(n95)] # MSS [S(n71), S(n91), S(n38), S(n78)] # MSS [S(n63), S(n87), S(n94), S(n1), S(n49)] # MSS [S(n32), S(n63), S(n82), S(n99), S(n45)] # elapsed_time:1387.30099988[sec]
  36. Experimental Result 2 • |Nodes|=150, Rnd(R)=0.5,without loops • Preferred Extension

    = Conflict Free + Admissible + Maximal # Experimental Result # MSS [S(n0), S(n56), S(n93), S(n12), S(n114)] # MSS [S(n129), S(n42), S(n53), S(n79), S(n106), S(n148)] # MSS [S(n6), S(n48), S(n116), S(n139), S(n1), S(n72)] # MSS [S(n87), S(n124), S(n136), S(n73)] # MSS [S(n30), S(n96), S(n136), S(n8), S(n89), S(n119)] # elapsed_time:6589.398[sec]
  37. Concluding Remarks • Dungの四外延はSMTソルバ+αで計算可能 • A SMT Solver + Enumeration

    + Hard/Soft Constraints • 他の計算⼿段との⽐較は? • Too slow?(検証予定) • 計算プログラム本体を修正することなく,他の制約条件を追加可能 • 数理議論学の実際の問題で,有⽤な制約条件は記述可能か?⇒調査予定
  38. References 1. On the acceptability of arguments and its fundamental

    role in nonmonotonic reasoning, logic programming and n-person games, Phan Minh Dung, Artificial Intelligence 77 (1995) 321-357 2. Handbook of Satisfiability, Armin Biere, Marijn Heule, Hans Van Maaren, Toby Walsh (Ed.), IOS Press (2009) 3. Z3 Prover, https://github.com/Z3Prover/z3/wiki 4. Model Theory (Encyclopedia of Mathematics and its Applications), Wilfrid Hodges, Cambridge University Press (1993) 5. Checking the acceptability of a set of arguments, Philippe Besnard and Sylvie Doutre, 6. Enumerating Infeasibility: Finding Multiple MUSes Quickly 7. Constraint Hierarchies, Alan Borning, Bjorn Freeman-Benson, and Molly Wilson, Lisp and Symbolic Computation, Vol. 5 No. 3, (September 1992), pages 223-270. 8. Finite Model Theory and Its Applications, Erich Gr¨aydel, Phokion G. Kolaitis, Leonid Libkin, Maarten Marx, Joel Spencer, Moshe Y. Vardi, Yde Venema and Scott Weinstein, Springer- Verlag Berlin Heidelberg (2007) 9. Handbook of Practical Logic and Automated Reasoning, John Harrison, Cambridge University Press (2009)