-
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.
- Corrected original DELX examples. - Version 0.9.1.
- Loading branch information
1 parent
043f04f
commit df46ea2
Showing
21 changed files
with
404 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
__version__ = "0.9.0" | ||
__version__ = "0.9.1" |
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 +1,3 @@ | ||
The examples in this folder are taken from the paper "Deontic Equilibrium Logic with eXplicit negation", see https://www.dc.fi.udc.es/~cabalar/DELX.pdf | ||
|
||
The examples in this folder are taken from the paper "Deontic Equilibrium Logic with eXplicit negation". | ||
See https://www.dc.fi.udc.es/~cabalar/DELX.pdf |
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,13 +1,20 @@ | ||
% C1 (Explicit versus Negative permission) | ||
|
||
% C1 (Explicit versus Negative permission) (1st example: Π ∪ (15)) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (iv) If it is permitted (explicit), I build a fence around my cottage | ||
f :- &permitted{f}. | ||
% (iv) If it is permitted (implicit), I build a fence around my cottage | ||
%f :- not &forbidden{f}. |
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,13 +1,20 @@ | ||
% C1 (Explicit versus Negative permission) | ||
|
||
% C1 (Explicit versus Negative permission) (2nd example: Π ∪ (16)) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
% (iv) If it is permitted (explicit), I build a fence around my cottage | ||
%f :- &permitted{f}. | ||
|
||
% (iv) If it is permitted (implicit), I build a fence around my cottage | ||
f :- not &forbidden{f}. |
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,11 +1,20 @@ | ||
|
||
% C2 (Contrary-to-Duty (CTD) and Compliance) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (v) If you put a fence when forbidden, you should pay a fine. | ||
&obligatory{pay} :- &forbidden{f}, f. |
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,13 +1,23 @@ | ||
|
||
% C3 (CTD and Dilemmas) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (v) If you put a fence when forbidden, you should pay a fine. | ||
&obligatory{pay} :- &forbidden{f}, f. | ||
|
||
% There is a fence. | ||
f. | ||
f. |
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,13 +1,23 @@ | ||
% C4 (CTD and Defeasible Obligations) | ||
|
||
% C4 (CTD and Defeasible Obligations) ((18) ∪ (3) ∪ {s,f}) | ||
|
||
% (i) There must be no fence, unless a permission is granted | ||
&forbidden{f} :- not &permitted{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (vi) If the cottage is by the sea (s), there may be a fence. | ||
&permitted{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% The cottage is by the sea. | ||
%s. | ||
s. | ||
|
||
% There is a fence. | ||
%f. | ||
f. |
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,17 +1,29 @@ | ||
% C5 (Constitutive Norms) | ||
|
||
% C5 (Constitutive Norms) (1st example: Π ∪ (19) ∪ {f}) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% No white fence if not fence. | ||
-w :- -f. | ||
% Not forbidden a white fence if not forbidden a fence. | ||
|
||
% Forbidden a white fence if forbidden a fence. | ||
&forbidden{w} :- &forbidden{f}. | ||
|
||
% There is a fence. | ||
f. | ||
|
||
% The fence is white. | ||
%w. | ||
w. |
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,15 +1,26 @@ | ||
% C5 (Constitutive Norms) (2nd example) | ||
|
||
% C5 (Constitutive Norms) (2nd example: (2) ∪ (20) ∪ {f}) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% If white fence, then fence. | ||
f :- w. | ||
|
||
% No white fence if not fence. | ||
-w :- -f. | ||
% Obligatory fence if non violated white fence. | ||
|
||
% Obligatory fence if non violated obligation of white fence. | ||
&obligatory{f} :- &obligatory{w}, not -w. | ||
% Forbidden white if non violated fence. | ||
|
||
% Forbidden white fence if non violated prohibition of fence. | ||
&forbidden{w} :- &forbidden{f}, not f. | ||
|
||
% There is a fence. | ||
f. | ||
f. |
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,15 +1,26 @@ | ||
% C6 (Defeasible Deontic Detachment) (1st example) | ||
|
||
% C6 (Defeasible Deontic Detachment) (1st example: Π ∪ (21) ∪ {f ∨ ¬f}) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (vii) If we put a fence, we must put a street mailbox (m). | ||
&obligatory{m} :- f. | ||
|
||
% (viii) If we do not put a fence, we must not put a street mailbox. | ||
&forbidden{m} :- -f. | ||
|
||
% Fence or not fence. | ||
f;-f. | ||
f; -f. |
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,15 +1,26 @@ | ||
% C6 (Defeasible Deontic Detachment) (2nd example) | ||
|
||
% C6 (Defeasible Deontic Detachment) (2nd example with conditional notation: Π ∪ (22) ∪ {f ∨¬f}) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (vii) If we put a fence, we must put a street mailbox (m). | ||
&obligatory{m | f}. | ||
|
||
% (viii) If we do not put a fence, we must not put a street mailbox. | ||
&obligatory{-m | -f}. | ||
|
||
% Fence or not fence. | ||
f;-f. | ||
f; -f. |
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,17 +1,28 @@ | ||
% C6 (Defeasible Deontic Detachment) (2nd example) | ||
|
||
% C6 (Defeasible Deontic Detachment) (2nd example: Π ∪ (22) ∪ {f ∨¬f}) | ||
|
||
% (i) There must be no fence (f). | ||
&obligatory{-f}. | ||
&forbidden{f}. | ||
|
||
% (ii) If there is a fence, it must be a white (w) fence. | ||
&obligatory{w} :- f. | ||
&obligatory{w} :- f, &forbidden{f}. | ||
|
||
% (iii) If the cottage is by the sea (s), there must be a fence. | ||
&obligatory{f} :- s. | ||
|
||
% A white fence is a fence. | ||
f :- w. | ||
|
||
% If it is obligatory a white fence, then it is obligatory a fence. | ||
&obligatory{f} :- &obligatory{w}. | ||
|
||
% (vii) If we put a fence, we must put a street mailbox (m). | ||
&obligatory{m} :- f. | ||
&obligatory{m} :- &obligatory{f}, not -f. | ||
|
||
% (viii) If we do not put a fence, we must not put a street mailbox. | ||
&forbidden{m} :- -f. | ||
&forbidden{m} :- &forbidden{f}, not f. | ||
|
||
% Fence or not fence. | ||
f;-f. | ||
f; -f. |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
% C1 (Explicit versus Negative permission) (1st example: Π ∪ (15)) | ||
|
||
%!trace_rule {"There must be no fence"} | ||
&forbidden{fence}. | ||
|
||
%!trace_rule {"It must be a white fence, if the prohibition of a fence is violated"} | ||
&obligatory{white_fence} :- &violated_prohibition{fence}. | ||
|
||
%!trace_rule {"There must be a fence, if the cottage is by the sea"} | ||
&obligatory{fence} :- sea. | ||
|
||
%!trace_rule {"A white fence is a fence"} | ||
fence :- white_fence. | ||
|
||
%!trace_rule {"It is obligatory a fence, if it is obligatory a white fence"} | ||
&obligatory{fence} :- &obligatory{white_fence}. | ||
|
||
%!trace_rule {"I build a fence around my cottage, if it is explicitly permitted"} | ||
fence :- &permitted{fence}. | ||
|
||
%!show_trace &obligatory{X}. | ||
%!show_trace &forbidden{X}. | ||
|
||
%!trace {"There is a fence"} fence. | ||
%!trace {"The cottage is by the sea"} sea. | ||
%!trace {"There is a white fence"} white. |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
% C1 (Explicit versus Negative permission) (2nd example: Π ∪ (16)) | ||
|
||
%!trace_rule {"There must be no fence"} | ||
&forbidden{fence}. | ||
|
||
%!trace_rule {"It must be a white fence, if the prohibition of a fence is violated"} | ||
&obligatory{white_fence} :- &violated_prohibition{fence}. | ||
|
||
%!trace_rule {"There must be a fence, if the cottage is by the sea"} | ||
&obligatory{fence} :- sea. | ||
|
||
%!trace_rule {"A white fence is a fence"} | ||
fence :- white_fence. | ||
|
||
%!trace_rule {"It is obligatory a fence, if it is obligatory a white fence"} | ||
&obligatory{fence} :- &obligatory{white_fence}. | ||
|
||
%!trace_rule {"I build a fence around my cottage, if it is implicitly permitted"} | ||
fence :- &permitted_implicitly{fence}. | ||
|
||
%!show_trace &obligatory{X}. | ||
%!show_trace &forbidden{X}. | ||
|
||
%!trace {"There is a fence"} fence. | ||
%!trace {"The cottage is by the sea"} sea. | ||
%!trace {"There is a white fence"} white. |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
% C2 (Contrary-to-Duty (CTD) and Compliance) | ||
|
||
%!trace_rule {"There must be no fence"} | ||
&forbidden{fence}. | ||
|
||
%!trace_rule {"It must be a white fence, if the prohibition of a fence is violated"} | ||
&obligatory{white_fence} :- &violated_prohibition{fence}. | ||
|
||
%!trace_rule {"There must be a fence, if the cottage is by the sea"} | ||
&obligatory{fence} :- sea. | ||
|
||
%!trace_rule {"A white fence is a fence"} | ||
fence :- white_fence. | ||
|
||
%!trace_rule {"It is obligatory a fence, if it is obligatory a white fence"} | ||
&obligatory{fence} :- &obligatory{white_fence}. | ||
|
||
%!trace_rule {"You should pay a fine, if you put a fence when forbidden"} | ||
&obligatory{pay} :- &violated_prohibition{fence}. | ||
|
||
%!show_trace &forbidden{X}. | ||
%!show_trace &obligatory{X}. | ||
|
||
%!trace {"There is a fence"} fence. | ||
%!trace {"The cottage is by the sea"} sea. | ||
%!trace {"There is a white fence"} white. | ||
%!trace {"You should pay a fine"} &obligatory{pay}. |
Oops, something went wrong.