"[" .
bracket ( ")" ) --> "(" .
bracket ( "}" ) --> "{" .

brackets --> bracket ( Close ), b...">

ブラケット構造の正しさ、プロローグ

金曜日の夜のエンターテイメント。

<br> bracket ( "]" ) --> "[" .<br> bracket ( ")" ) --> "(" .<br> bracket ( "}" ) --> "{" .<br><br>brackets --> bracket ( Close ), brackets , Close , brackets .<br>brackets --> [].<br><br> check ( BracesStr ) :-<br> phrase ( brackets , BracesStr ), ! .<br>

?- check("[[[]]][][[]][()]{}[]").
true.

?- check("[[[)]]][][[]][()]{}[]").
false.

PSあなたの好きなYPの決定は大歓迎です)


Source: https://habr.com/ru/post/J50693/


All Articles