Update examples
This updates the examples to showcase the scope of anthem’s feature set. New examples are added concerning placeholders, hiding predicates, and simplifications related to integer variables.
This commit is contained in:
@@ -1,10 +1,18 @@
|
||||
#external color(1).
|
||||
#external edge(2).
|
||||
#external vertex(1).
|
||||
#show color/2.
|
||||
|
||||
% assign a set of colors to each vertex
|
||||
{color(V, C)} :- vertex(V), color(C).
|
||||
|
||||
% at most one color per vertex
|
||||
:- color(V, C1), color(V, C2), C1 != C2.
|
||||
|
||||
% at least one color per vertex
|
||||
covered(V) :- color(V, _).
|
||||
:- vertex(V), not covered(V).
|
||||
|
||||
% adjacent vertices don’t share the same color
|
||||
:- color(V1, C), color(V2, C), edge(V1, V2).
|
||||
:- color(V, C1), color(V, C2), C1 != C2.
|
||||
|
||||
#show color/2.
|
||||
|
||||
#external vertex(1).
|
||||
#external edge(2).
|
||||
#external color(1).
|
||||
|
Reference in New Issue
Block a user