Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 867 Bytes

README.md

File metadata and controls

44 lines (33 loc) · 867 Bytes

CNApy screenshot Build Status

A tool that formats your clingo code.

Compile

cargo build --release

Run

.target/release/clingofmt example.lp > formated_example.lp

This will turn

% Check lower and upper bounds via "Sinz counter" on selected varying atoms
index(A,I):-vary(A),I = #count{ B : vary(B),B <= A },not bounds(0,0).
counter(I,1)  :-index(A,I),bounds(L,U),L <= I,selected(A).

into

% Check lower and upper bounds via "Sinz counter" on selected varying atoms
index(A, I) :-
    vary(A),
    I = #count {
        B :
            vary(B),
            B <= A
    },
    not bounds(0, 0).

counter(I, 1) :-
    index(A, I),
    bounds(L, U),
    L <= I,
    selected(A).