generated from potassco/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added simple explanations for user input
- Loading branch information
Showing
2 changed files
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
% Check that variables exist | ||
:- user_value(X,_), not type(X,_). | ||
:- user_include(X), not type(X,_). | ||
unsat("not exists",X) :- user_value(X,_), not type(X,_). | ||
unsat("not exists",X) :- user_include(X), not type(X,_). | ||
|
||
% Check variable type | ||
:- user_include(X), type(X,T), not part(T). | ||
:- user_value(X,V), type(X,T), #false : discrete(T); #false : integer(T). | ||
unsat("not part",X) :- user_include(X), type(X,T), not part(T). | ||
unsat("not attribute",X) :- user_value(X,V), type(X,T), #false : discrete(T); #false : integer(T). | ||
|
||
% Check valid domain | ||
:- user_value(X,V), type(X,T), not domain(T,V). | ||
|
||
unsat("outside domain",(X,V)) :- user_value(X,V), type(X,T), discrete(T), not domain(T,V). | ||
unsat("outside domain",(X,V)) :- user_value(X,V), type(X,T), integer(T), range(T,Min,Max), V < Min. | ||
unsat("outside domain",(X,V)) :- user_value(X,V), type(X,T), integer(T), range(T,Min,Max), V > Max. | ||
% Check max cardinality not exceeded | ||
% For now this is covered by line 3 (only max amount of objects is grounded) | ||
|
||
#show unsat/2. |