我有一个工具可以产生这样的输出 -
(check (= Start
(+ (if (<= takeA giveA) 0 1)
(if (<= takeB giveB) 0 1)
(if (<= takeC giveC) 0 1)
(if (<= takeD giveD) 0 1))))
(check (and (>= takenBefore_A 0) (<= takenBefore_A 4)))
(check (and (>= givenBefore_A 0) (<= givenBefore_A 4)))
(check (= risk_A
(+ Start 1 (- takenBefore_A givenBefore_A))))
(check (= takenBefore_A
(+ (if (<= takeB takeA) 1 0)
(if (<= takeC takeA) 1 0)
(if (<= takeD takeA) 1 0))))
(check (= givenBefore_A
(+ (if (<= giveA takeA) 1 0)
(if (<= giveB takeA) 1 0)
(if (<= giveC takeA) 1 0)
(if (<= giveD takeA) 1 0))))
(check (and (>= takenBefore_B 0) (<= takenBefore_B 4)))
(check (and (>= givenBefore_B 0) (<= givenBefore_B 4)))
(check (= risk_B
(+ Start 1 (- takenBefore_B givenBefore_B))))
(check (= takenBefore_B
(+ (if (<= takeA takeB) 1 0)
(if (<= takeC takeB) 1 0)
(if (<= takeD takeB) 1 0))))
(check (= givenBefore_B
(+ (if (<= giveA takeB) 1 0)
(if (<= giveB takeB) 1 0)
(if (<= giveC takeB) 1 0)
(if (<= giveD takeB) 1 0))))
(check (and (>= takenBefore_C 0) (<= takenBefore_C 4)))
(check (and (>= givenBefore_C 0) (<= givenBefore_C 4)))
(check (= risk_C
(+ Start 1 (- takenBefore_C givenBefore_C))))
我想有这样的输出 -
(check (= Start (+ (if (<= takeA giveA) 0 1) (if (<= takeB giveB) 0 1) (if (<= takeC giveC) 0 1) (if (<= takeD giveD) 0 1))))
(check (and (>= takenBefore_A 0) (<= takenBefore_A 4)))
(check (and (>= givenBefore_A 0) (<= givenBefore_A 4)))
(check (= risk_A (+ Start 1 (- takenBefore_A givenBefore_A))))
(check (= takenBefore_A (+ (if (<= takeB takeA) 1 0) (if (<= takeC takeA) 1 0) (if (<= takeD takeA) 1 0))))
(check (= givenBefore_A (+ (if (<= giveA takeA) 1 0) (if (<= giveB takeA) 1 0) (if (<= giveC takeA) 1 0) (if (<= giveD takeA) 1 0))))
(check (and (>= takenBefore_B 0) (<= takenBefore_B 4)))
(check (and (>= givenBefore_B 0) (<= givenBefore_B 4)))
(check (= risk_B (+ Start 1 (- takenBefore_B givenBefore_B))))
(check (= takenBefore_B (+ (if (<= takeA takeB) 1 0) (if (<= takeC takeB) 1 0) (if (<= takeD takeB) 1 0))))
(check (= givenBefore_B (+ (if (<= giveA takeB) 1 0) (if (<= giveB takeB) 1 0) (if (<= giveC takeB) 1 0) (if (<= giveD takeB) 1 0))))
(check (and (>= takenBefore_C 0) (<= takenBefore_C 4)))
(check (and (>= givenBefore_C 0) (<= givenBefore_C 4)))
(check (= risk_C (+ Start 1 (- takenBefore_C givenBefore_C))))
我使用以下命令VIM
生成必要的输出,具体取决于我要加入的行数 -
:.,+3join
我想知道,如果我可以自动执行此操作而不是手动执行此操作。这里的关键点是,在每一行上,打开的括号数将等于关闭的括号数。