このような出力を生成するツールがあります-
(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
手動で行うのではなく、自動的にこれを行うことができるかどうか疑問に思っています。ここでの重要な点は、各行で開いた括弧の数が閉じた括弧の数と同じになるということです。