【论文精读】时序逻辑推理之高效的参数学习 Efficient Parametric Identification for STL

前言:由于上一篇文章Parametric Identification of Temporal Properties中的算法效率复杂度过高,因此找到了这一篇文献看看是否有更高效的算法.

主要参考文献:
Alexey Bakhirkin, Thomas Ferrère, and Oded Maler. 2018. Efficient Parametric Identification for STL. In Proceedings of the 21st International Conference on Hybrid Systems: Computation and Control (part of CPS Week) (HSCC '18). Association for Computing Machinery, New York, NY, USA, 177–186. DOI:https://doi.org/10.1145/3178126.3178132

概览

此文是在前文基础上的改进,同样给定公式模板,寻找满足信号公式参数的取值范围。

流水账笔记

1 Introduction

介绍了STL的应用背景,提到STL的主要应用场景是监督。这里又cue了上一篇文献的工作。本文引入了satisfaction signal, robustness signal 和 parametric validity signal,这些名词具体是什么还得接着往下看。这里先mark一下原文:

The major contribution of the paper is a new procedure to compute validity domains that follows the computation of satisfaction and robustness signals by propagating them as function of time, from sub-formulas to formulas. With each formula φ \varphi φ and a signal w w w we associate a parametric validity signal whose value at t t t indicates the set of parameter valuations v v v such that ( w , t ) ⊨ φ [ v ] (w,t)\models\varphi[v] (w,t)φ[v].

2 Parametric Signal Temporal Logic

这里提到STL可以描述布尔信号和实数信号的特性,这里可以将布尔信号看作取值为0或1的实数信号,所以这里不将两种信号加以区分。

PSTL/极性/可行域等相关介绍同上一篇文献

算子 “ ⋄ \diamond ” & “ □ \square

因为我老是分不清eventually和always的两个符号,所以这里记一下:
e v e n t u a l l y : ⋄ ⋄ φ ≡ t r u e   U φ a l w a y s : □ □ φ ≡ ¬ ⋄ ¬ φ eventually:\diamond \\ \diamond \varphi \equiv true\ \mathcal{U}\varphi \\ always: \square \\ \square \varphi \equiv \neg \diamond \neg \varphi eventually:φtrue Uφalways:φ¬¬φ

算子 “ U \mathcal{U} U” & “ R \mathcal{R} R

φ   U [ a , ∞ ) ψ ≡ □ [ 0 , a ] ( φ   U ψ ) φ   U [ a , b ] ψ ≡ ( ⋄ [ a , b ] ψ ) ∧ ( φ   U [ a , ∞ ] ψ ) ≡ ( ⋄ [ a , b ] ψ ) ∧ ( □ [ 0 , a ] ( φ   U ψ ) ) \varphi \ \mathcal{U}_{[a,\infty)}\psi \equiv \square_{[0,a]}(\varphi\ \mathcal{U} \psi)\\ \varphi \ \mathcal{U}_{[a,b]}\psi \equiv (\diamond_{[a,b]}\psi)\land(\varphi\ \mathcal{U}_{[a,\infty]}\psi) \equiv (\diamond_{[a,b]}\psi)\land (\square_{[0,a]}(\varphi\ \mathcal{U} \psi)) φ U[a,)ψ[0,a](φ Uψ)φ U[a,b]ψ([a,b]ψ)(φ U[a,]ψ)([a,b]ψ)([0,a](φ Uψ))

上面的式子这么理解:信号至少满足 φ \varphi φ a时间后满足 ψ \psi ψ,之后的状态概不负责。

下面的式子这么理解:信号至少持续满足 φ \varphi φ要求a时间,最长持续满足 φ \varphi φ要求b时间后满足要求 ψ \psi ψ,之后的状态概不负责。

接下来介绍与until互补的概念,R代表Release,和Until算子形成互补的含义。
φ R ψ ≡ ¬ ( ¬ φ U ¬ ψ ) \varphi \mathcal{R} \psi \equiv \neg(\neg \varphi \mathcal{U}\neg\psi) φRψ¬(¬φU¬ψ)
这里这样理解:信号一旦满足 φ \varphi φ,之后就会持续满足 ψ \psi ψ.

Parametric Validity Signal

这里是本文的一个新概念,我这里把它翻译为可行域函数(信号),指的是从时间t之后的信号序列 w [ t ] w[t] w[t](后缀)对应的参数可行域。总的可行域 D ( φ , w ) D(\varphi,w) D(φ,w)就是 d ( φ , w ) [ 0 ] d(\varphi,w)[0] d(φ,w)[0]。这里之所以区别于上一篇文章,提出一个随着时间变化的可行域,和本文中提出的Backshift算法大有关系,即从最后一段的可行域 d ( φ , w ) [ n ] d(\varphi,w)[n] d(φ,w)[n] 递归到 d ( φ , w ) [ 0 ] d(\varphi,w)[0] d(φ,w)[0].

单调性假设

每个变量的极性在计算中不改变 consistent polarity, 即satisfaction相对于每个变量是单调的。对于极性不恒定的变量同样可以使用上一篇文章中的坐标变换法切换极性,再用得到的可行域与 p = p ′ p=p' p=p平面相交得到原公式的可行域??这一句的推导文中没给,我不理解/(ㄒoㄒ)/,原文先放在这里。

Given a formula φ \varphi φ with an inconsistent parameter p p p, we can replace its negative occurrences with a fresh parameter p ′ p' p, and keep the positive occurrences untouched. Then we can intersect the validity domain of this new formula with the plane p = p ′ p = p' p=p to obtain the validity domain of the original formula.

Negation Normal Form 假设

推导时使用的公式模板全是否定正则表示,即“ ¬ \neg ¬”符号只能出现在原子命题“ φ \varphi φ”或“ ψ \psi ψ”前。通过以下表达式进行转换:
¬ ⋄ [ a , b ] φ ⇔ □ [ a , b ] ¬ φ ¬ ( φ U ψ ) ⇔ ¬ φ R ¬ ψ \neg \diamond_{[a,b]}\varphi \Leftrightarrow \square_{[a,b]}\neg\varphi \qquad \neg(\varphi \mathcal{U}\psi)\Leftrightarrow\neg\varphi\mathcal{R}\neg\psi ¬[a,b]φ[a,b]¬φ¬(φUψ)¬φR¬ψ

3 Computing the Validity Signals

定义了分段常值信号(piecewise-constant signal),也就是我们在电路中学过的采样保持信号。

提出了一条定理:
采样保持信号时序逻辑公式的可行域函数也是分段常值的,其图形表示可以看作是有限个长方体的组合。接下来给了简单的证明,后面再看。

3.1 Overall Algorithm

那么可行域函数究竟怎么计算呢?对于布尔约束、简单不等式约束、逻辑与或操作以及带上下限的Eventually和Always操作符,作者分别给出了对应的可行域计算方法。

3.1.1 布尔约束

所谓布尔约束没什么用,就是 φ = t r u e / f a l s e \varphi=true /false φ=true/false,与参数无关。所以 φ = t r u e \varphi=true φ=true的时候,参数取任意值都可以满足约束,任意时刻的可行域函数都是指向全空间;反之,当 φ = f a l s e \varphi=false φ=false的时候,参数取任意值都不能满足约束,任意时刻的可行域为空集。

3.1.2 不等式约束

不等式分为和常数的比较与和参数的比较。与常数的比较同样与参数无关,逻辑与布尔约束相同。与参数的比较也很简单,参数空间和不等式表示的空间是同一个。

3.1.3 逻辑与或操作

与或操作相当于将两个子式得可行域组合起来,再在对齐的绝对时间区间内分别取交集或并集。画了一个图表示这个过程。
与或操作

3.1.4 Eventually & Always
前移消去量词

d ( ⋄ [ a , b ] φ , w ) [ t ] d(\diamond_{[a,b]}\varphi,w)[t] d([a,b]φ,w)[t]是区间 [ t + a , m i n { t + b , ∣ w ∣ } ] [t+a,min\{t+b,|w|\}] [t+a,min{t+b,w}]上所有可行域的并集。接下来文章得到了一条这样的结论:
∃ t ′ > 0 ∀ t ∈ [ m a x { 0 , t ′ − b } , t ′ − a ] d ( ⋄ [ a , b ] φ , w ) [ t ] ⊆ d ( φ , w ) [ t ′ ] \exist t'>0 \quad \forall t\in [max\{0,t'-b\},t'-a] \\ d(\diamond_{[a,b]}\varphi,w)[t]\subseteq d(\varphi,w)[t'] t>0t[max{0,tb},ta]d([a,b]φ,w)[t]d(φ,w)[t]
这里提出2个新概念——forward cone和backward cone,体现的是对于时刻和时段向后或向前的推移。这里forward和backward很好理解,至于这个cone,可以想象一系列拥有一个公共顶点的线段的集合,在这里这个顶点就是时间点 t ′ t' t,上面连接着长度从 a a a b b b的线段。上面公式的推导可以这么理解,如果一组参数赋值能够使信号在 t ′ t' t时满足 φ \varphi φ,那么在 t ′ t' t向前推 [ a , b ] [a,b] [a,b]时间,这组参数赋值也能够是信号在这段时间内满足 ⋄ [ a , b ] φ \diamond_{[a,b]}\varphi [a,b]φ,因此后者的可行域被前者所包含。而对于always,公式的可行域就更小了,所以上式的“ ⋄ \diamond ”可以直接替换为“ □ \square

backshifting算法

感谢作者论文中的直观清晰的图示和伪码,这里就不再详细记录了。但是这时发现一个问题,[a,b]作为算法的输入直接填入。因此算法只解决了fixed temporal parameter的问题,这里的变量只有尺度参数。
迁移函数
可行域变量的初始化
迭代操作

3.1.5 Until & Release

这里先假设了采样间隔对齐的情况以方便讨论。这里进行了分情况讨论:

  • 如果 t ∈ [ t n − 1 , t n ) t\in[t_{n-1},t_n) t[tn1,tn),即最后一个时段,分段常值信号没有变化,为了满足 φ U ψ \varphi\mathcal{U}\psi φUψ,则信号需要同时满足 ψ \psi ψ φ \varphi φ,因此此时的可行域 d n U = d n φ ∩ d n ψ . d_n^\mathcal{U}=d^\varphi_n \cap d^\psi_n. dnU=dnφdnψ.
  • 对于其他时段,可以通过递归的方法对可行域进行表示:
    d i U = ( d i φ ∩ d i ψ ) ∪ ( d i φ ∩ d i + 1 U ) d_i^\mathcal{U}=(d_i^\varphi\cap d_i^\psi)\cup(d_{i}^\varphi\cap d_{i+1}^\mathcal{U}) diU=(diφdiψ)(diφdi+1U)
    怎么理解呢?这里又分了两种情况,第一种是在第一个时间间隔中, φ \varphi φ ψ \psi ψ就同时满足;第二种是第一个时间间隔只满足 φ \varphi φ,在后面的时间才出现满足 ψ \psi ψ的信号。这里也可以将上式进一步组合来看:
    d i U = ( d i φ ∩ d i ψ ) ∪ ( d i φ ∩ d i + 1 U ) = d i φ ∩ ( d i φ ∪ d i + 1 U ) d_i^\mathcal{U}=(d_i^\varphi\cap d_i^\psi)\cup(d_{i}^\varphi\cap d_{i+1}^\mathcal{U})=d_i^\varphi \cap(d_i^\varphi\cup d_{i+1}^\mathcal{U}) diU=(diφdiψ)(diφdi+1U)=diφ(diφdi+1U)
    即,在t时刻,信号一定要满足 φ \varphi φ,接着要么同时满足 ψ \psi ψ,要么在后面的时间在满足 ψ \psi ψ,期间信号都满足 φ U ψ \varphi\mathcal{U}\psi φUψ
    U和R算法

3.2 Implementation Details

3.2.1 Upward-Closed Rectangular Sets

这里对使用的数据结构进行了介绍

  • Partial Order: 这里定义的偏序的比较相当于全部元素进行比较,且要求比较结果一致。
  • Upward-closure:即向上开口的闭集合。

在这里插入图片描述

  • Support Set   ↓ U \ \downarrow U  U: 开口向上,且形状为长方形
    在这里插入图片描述

为了优化并集操作的效率,通常操作的将维度大于二的support set放在树形数据结构里。但是这里仅使用了数组进行存储。

使用与上一篇文献类似的方法进行变量替换,就可以把可行域转换为upper-closed了。

3.2.2 Distributing Temporal Operators over Boolean

⋄ [ a , b ] ( φ ∨ ψ ) ⇔ ⋄ [ a , b ] φ ∨ ⋄ [ a , b ] ψ □ [ a , b ] ( φ ∧ ψ ) ⇔ ⋄ [ a , b ] φ ∧ □ [ a , b ] ψ \diamond_{[a,b]}(\varphi\lor\psi)\Leftrightarrow \diamond_{[a,b]}\varphi \lor \diamond_{[a,b]}\psi \\ \square_{[a,b]}(\varphi\land\psi)\Leftrightarrow \diamond_{[a,b]}\varphi \land \square_{[a,b]}\psi [a,b](φψ)[a,b]φ[a,b]ψ[a,b](φψ)[a,b]φ[a,b]ψ
这样处理是因为 φ \varphi φ ψ \psi ψ里面带的参数可能会不一样,将他们拆开来可以避免在计算过程中增加维度,计算效率更高(文中声称提升了10倍)。

3.2.3 Merging Adjacent Segments

这里将信号值相同的两个相邻时间段进行了合并,这样就可以缩短信号序列的长度,从而减少有效域信号的计算量。(因此上文中谈到的采样间隔不一定是均匀的)

4 Examples

使用的测试信号如下:
在这里插入图片描述

4.1 Range of Values

作者利用 □ ( x ≤ p 1 ∧ x ≥ p 2 ) \square(x\leq p_1 \land x\geq p_2 ) (xp1xp2)来确定信号的上下限,求出可行域的边界值就是最大最小值。(但是吧,求上下限这个作用也太鸡肋了。)

4.2 Enumeration of Values

接下来换了一条公式: ⋄ ( x ≤ p 1 ∧ x ≥ p 2 ) \diamond(x\leq p_1 \land x\geq p_2 ) (xp1xp2),得到的可行域如下。((3,-3)那个点图上应该是标错了)用作者的话说,这样操作下来得到信息的作用不大,但是麻烦不小。
在这里插入图片描述

4.3 Common Threshold

□ ( x ≥ p ∨ y ≥ p ) \square(x\geq p\lor y\geq p) (xpyp)找公共阈值。

4.4 High/Low Values

接下来的公式就有意思多了:
□ ⋄ [ 0 , t e d g e + t s t a b ] ( ( □ [ 0 , t s t a b ] ) x ≤ p 1 ) ∨ ( □ [ 0 , t s t a b ] ) x ≥ p 2 ) ) ) \square\diamond_{[0,t_{edge}+t_{stab}]}((\square_{[0,t_{stab}]})x\leq p_1)\lor(\square_{[0,t_{stab}]})x\geq p_2))) [0,tedge+tstab](([0,tstab])xp1)([0,tstab])xp2)))
以上公式表示的是:
每当信号开始发生跳变,在 t e d g e + t s t a b t_{edge}+t_{stab} tedge+tstab时间内,信号都能维持稳态至少 t s t a b t_{stab} tstab时间。此类信息在电路设计中还是比较有用的。但是这里的参数依然只有尺度参数 p 1 p_1 p1 p 2 p_2 p2,跳变时间和稳定时间都是作为已知的参数填入的。

5 Performance

理论和实验上对算法进行了评估,实验验证用了OCaml.
这里提到可行域可能会不可比较(incomparable),这里是什么意思不太理解。
目前的集合运算的计算复杂度与集合中点数 l l l的平方成正比,这个数据可以通过更有效的数据结构进行改善。

5.1 Artificially Generated Signals

手工生成了三组实验信号,分别是sin信号、cos信号和方波信号,每种信号准备了3种长度( 1 0 4 / 1 0 5 / 1 0 6 10^4/10^5/10^6 104/105/106)的版本。分别进行了上一节谈到的范围、公共阈值等的计算。

5.2 Airplane Pitch Control Model

另外还研究了Simulink中飞机俯仰角控制模型的仿真的Command和Response信号的差值。

实验结果体现在下表:

在这里插入图片描述
这篇文章中的计算速度还是可以的,基本可以秒级完成计算了。本文还测试了不同时间窗,其中在 φ 6 , 3 \varphi_{6,3} φ6,3那里直接Timeout了,说明取时间窗对算法的稳定性有较大的影响。

6 Related Work

和参数学习相关的软件工具:

  • S-Taliro:

Yashwanth Annpureddy, Che Liu, Georgios E Fainekos, and Sriram Sankaranarayanan.2011. S-TaLiRo: A Tool for Temporal Logic Falsification for Hybrid Systems… In TACAS, Vol. 6605. Springer, 254–257.

  • Breach:

Alexandre Donzé. 2010. Breach, a toolbox for verification and parameter synthesis of hybrid systems.. In CAV, Vol. 10. Springer, 167–170.

工业界案例分析:

Xiaoqing Jin, Alexandre Donzé, Jyotirmoy V. Deshmukh, and Sanjit A. Seshia. 2013. Mining Requirements from Closed-loop Control Models. In HSCC.
Pierluigi Nuzzo, Huan Xu, Necmiye Ozay, John B Finn, Alberto L Sangiovanni-
Vincentelli, Richard M Murray, Alexandre Donzé, and Sanjit A Seshia. 2014. A contract-based methodology for aircraft electric power system design. IEEE
Access 2 (2014), 1–25.

同时处理正例和反例的监督学习:

Sara Bufo, Ezio Bartocci, Guido Sanguinetti, Massimo Borelli, Umberto Lucangelo, and Luca Bortolussi. 2014. Temporal Logic Based Monitoring of Assisted Ventilation in Intensive Care Patients. In Leveraging Applications of Formal Methods, Verification and Validation. Specialized Techniques and Applications - 6th International Symposium, ISoLA 2014, Imperial, Corfu, Greece, October 8-11, 2014, Proceedings, Part II. 391–403. https://doi.org/10.1007/978-3-662-45231-8_30
Giuseppe Bombara, Cristian-Ioan Vasile, Francisco Penedo, Hirotoshi Yasuoka, and Calin Belta. 2016. A Decision Tree Approach to Data Classification using Signal Temporal Logic. In HSCC. ACM, 1–10.
Zhaodan Kong, Austin Jones, and Calin Belta. 2017. Temporal logics for learning and detection of anomalous behavior. IEEE Trans. Automat. Control 62, 3 (2017), 1210–1222.

考虑系统模型:

Bardh Hoxha, Adel Dokhanchi, and Georgios Fainekos. 2017. Mining parametric temporal logic properties in model-based design for cyber-physical systems. International Journal on Software Tools for Technology Transfer (2017), 1–15.
Susmit Jha, Ashish Tiwari, Sanjit A. Seshia, Tuhin Sahai, and Natarajan Shankar. 2017. TeLEx: Passive STL Learning Using Only Positive Examples. In Runtime Verification. 208–224.
Eric S Kim, Murat Arcak, and Sanjit A Seshia. 2016. Directed specifications and assumption mining for monotone dynamical systems. In Proceedings of the 19th International Conference on Hybrid Systems: Computation and Control. ACM,
21–30.
Hengyi Yang, Bardh Hoxha, and Georgios E Fainekos. 2012. Querying Parametric Temporal Logic Properties on Embedded Systems. In ICTSS. Springer, 136–151.

STL监督方法:

Lubos Brim, P Dluhoš, D Šafránek, and Tomas Vejpustek. 2014. STL: Extending signal temporal logic with signal-value freezing operator.* Information and Computation 236 (2014), 52–67.

基于优化方法的参数学习:太多了,之后的文章几乎都是这么做的,列1篇吧

H. Abbas and G. Fainekos, “Computing descent direction of MTL robustness for non-linear systems,” 2013 American Control Conference, 2013, pp. 4405-4410, doi: 10.1109/ACC.2013.6580518.

7 Conclusions and Future Work

未来方向

  • 优化数据结构(可行域的具体表示)
  • 分段常值插值法和分段线性插值法的比较
  • 探究采样率的影响
  • 考虑时序参数(Timing Parameter)
  • 探究鲁棒性
  • 将公式作为feature extractor使用,实现高维数据的降维,供其他学习、聚类算法使用

思考与记录

  1. 这篇文章只探究了计算效率,但是得出的数据的有效性和实用性并没有进行验证。那么如何评价时序逻辑公式的正确性呢?这还有待其他文献解答。
  2. 时序参数的计算如何得到?
  3. 这篇文章相较于上一篇为什么效率增加这么多呢?1) 在信号的处理方式上,piecewise-constant相较于piecewiese-linear,可行域计算要简便得多。2) baskshift算法采用了递归的方式避免了重复、大量的计算
  4. 有没有不用计算有效域的方法?直接计算出optimal valuation呢?
  5. 安利分析中得到的公式实用价值不高,有没有更加有意义的场景?
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值