Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI update #3

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
11134e6
Attempt to implement a custom function to update the constant from th…
lognece Jul 4, 2024
87afb5f
Fixed the update_constant in custom_backend to dynamically update the…
lognece Jul 4, 2024
3df97a9
- Custom backend function update_constant() now works as it should.
lognece Jul 8, 2024
0e6e97e
Changed the Repo format and made minor changes to the ui appearance
lognece Jul 14, 2024
6a4b41e
Changed the Repo format and made minor changes to the ui appearance (…
lognece Jul 14, 2024
19f22cc
Changed UI:
lognece Jul 16, 2024
f236ac3
Added description of the custom_download method to the README
lognece Jul 16, 2024
f3a3283
added screenshots
lognece Jul 16, 2024
25fbda9
added screenshots to the README
lognece Jul 16, 2024
7d5c36e
added side bar with subsets of modules and calculations of remaning c…
lognece Jul 22, 2024
6098eff
added responsive layout, progress bar
lognece Aug 27, 2024
e1ffffd
- added a new container with modules with checkboxes for the custom s…
lognece Aug 27, 2024
587ce2a
- ui_extra.lp has additional left panel for module preference
lognece Sep 7, 2024
690d753
updated cogsys _info.lp: added explanations
lognece Sep 7, 2024
8de699f
added modal to the module
lognece Oct 1, 2024
74f18f8
Changes sus
susuhahnml Oct 1, 2024
fd049bb
preference + modal improvement content
lognece Oct 8, 2024
076e884
Improved UI with preferences
susuhahnml Oct 8, 2024
f9c2dad
- separated huge ui file into parts: layout, menu bar, modals, module…
lognece Oct 9, 2024
2862fa9
Changes in the Modal
lognece Oct 9, 2024
290d7b9
Update ideas for UI and functions
susuhahnml Oct 9, 2024
d87a2d2
Small adjustments to the layout
lognece Oct 15, 2024
427e535
added exams
lognece Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Created by pytest automatically.
venv/
venv-python3.10/
studyreg_programs/
/clinguin
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
# study-reg-clinguin
Clinguin UI for Study regulations
# Running Clinguin Program
## Prerequisites

### Usage
- Python 3.10

#### cogsys.lp:
```
clinguin client-server --domain-files new/instance/cogsys.lp new/encoding.lp --ui-files new/ui.lp -c n=4
```
#### cscbsc.lp:
```
clinguin client-server --domain-files new/instance/cscbsc.lp new/encoding.lp --ui-files new/ui.lp -c n=4
```
#### cscmsc.lp:
```
clinguin client-server --domain-files new/instance/cscmsc.lp new/encoding.lp --ui-files new/ui.lp -c n=4
```
#### dsmsc.lp:
```
clinguin client-server --domain-files new/instance/dsmsc.lp new/encoding.lp --ui-files new/ui.lp -c n=4
```
#### irsba.lp:
```
clinguin client-server --domain-files new/instance/irsba.lp new/encoding.lp --ui-files new/ui.lp -c n=4
```
## Instructions

1. **Clone the repository and navigate to the project directory:**
```bash
git clone https://github.com/krr-up/study-reg-clinguin.git
cd study-reg-clinguin
```

### Clinguin version
`Clinguin 1.0.16`
2. **Install the required dependencies:**
```bash
pip install -r requirements.txt
```

3. **Run the Clinguin server:**
```bash
clinguin client-server --domain-files instances/cogsys.lp encodings/meta.lp encodings/cogsys_info.lp encodings/preference.lp --ui-files ui/ui_main.lp -c n=3
```

### Clinguin Version

`Clinguin 2.0.0`
Empty file removed TODOS.md
Empty file.
Binary file added encodings/.DS_Store
Binary file not shown.
103 changes: 103 additions & 0 deletions encodings/cogsys_info.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
% This instance models the structure of the study program "Cognitive Systems: Language, Learning and Reasoning (COG)".
% It defines the program, the modules offered, and the corresponding examinations for each module.

% The `program/4` predicate defines the overall study program, consisting of:
% - The program abbreviation (e.g., "COG").
% - The full title of the program (e.g., "Cognitive Systems: Language, Learning and Reasoning").
% - The degree offered (e.g., "MS" for Master of Science).
% - The version of the program (e.g., "20142").

% The `module_program/5` predicate defines the modules within the program, consisting of:
% - A module ID (e.g., "55580").
% - The full title of the module (e.g., "Machine Learning and Data Analysis").
% - The module abbreviation (e.g., "bm2").
% - The number of credits for the module (e.g., "9").
% - The program the module belongs to (e.g., "COG").

% The `examination/6` predicate defines the examination tasks for each module, consisting of:
% - An exam ID (e.g., "555802").
% - The form of the examination (e.g., "MP" for oral examination).
% - The title of the examination (e.g., "Mündliche Prüfung").
% - The examination type (e.g., "PL" for graded exams, "SL" for ungraded performance or ).
% - The module the exam is part of (e.g., "bm2").
% - The study program it is part of (e.g., "COG").

% Degrees:
% - B2: Zwei-Fach-Bachelor (Two-subject Bachelor)
% - BA: Bachelor of Arts
% - BL: Bachelor of Education
% - ML: Master of Education
% - MT: Master of Arts

% Examination types:
% - PL: primary examination
% - PNL: secondary examination
% - SL: Studienleistung (an ungraded academic achievement that is not required for module completion, with no prerequisite checks)

% Examination forms:
% MP: Mündliche Prüfung (Oral Exam)
% V: Vorlesung (Lecture)
% U: Übung (Exercise)
% PR: Praktisches Arbeiten (Practical Work)
% PJ: Projekt (Project)
% V1: Vorlesung oder Seminar (Lecture or Seminar)
% S: Seminar (Seminar)


program("COG","Cognitive Systems: Language, Learning and Reasoning","MS","20142").
module_program("55580","Machine Learning and Data Analysis",bm2,9,"COG").
examination(ep_bm2__208555,"MP","Mündliche Prüfung","PL",bm2,"COG").
examination(es_bm2__218555,"V","Intelligent Data Analysis","SL",bm2,"COG").
examination(es_bm2__318555,"U","Intelligent Data Analysis","PNL",bm2,"COG").
module_program("55590","Advanced Problem Solving Techniques",bm3,9,"COG").
examination(ep_bm3__109555,"MP","Klausur","PL",bm3,"COG").
examination(es_bm3__119555,"V","Vorlesung","SL",bm3,"COG").
examination(es_bm3__219555,"U","Übung","SL",bm3,"COG").
examination(es_bm3__319555,"PR","Praktisches Arbeiten","PNL",bm3,"COG").
examination(es_bm3__419555,"PJ","Projekt","PNL",bm3,"COG").
module_program("55600","Foundations of Computer Science",fm2,6,"COG").
examination(ep_fm2__100655,"MP","Mündliche Prüfung","PL",fm2,"COG").
examination(es_fm2__110655,"V","Video-Vorlesung","SL",fm2,"COG").
examination(es_fm2__210655,"U","Übung","PNL",fm2,"COG").
module_program("55610","Current Topics in Computational Intelligence 1",am31,6,"COG").
examination(ep_am31__111655,"V1","Vorlesung oder Seminar","PL",am31,"COG").
module_program("55620","Current Topics in Computational Intelligence 2",am32,6,"COG").
examination(ep_am32__112655,"V1","Vorlesung oder Seminar","PL",am32,"COG").
module_program("55630","Project in Computational Intelligence",pm3,12,"COG").
examination(es_pm3__113655,"S","Seminar","PL",pm3,"COG").
module_program("82190","Advanced Natural Language Processing",bm1,9,"COG").
examination(ep_bm1__109128,"MP","Klausur","PL",bm1,"COG").
examination(ep_bm1__209128,"MP","Abschlussprojekt","PL",bm1,"COG").
examination(es_bm1__119128,"V","Vorlesung","SL",bm1,"COG").
examination(es_bm1__219128,"U","Übung","PNL",bm1,"COG").
module_program("82200","Foundations of Mathematics",fm1,6,"COG").
examination(ep_fm1__100228,"MP","Mündliche Prüfung","PL",fm1,"COG").
examination(es_fm1__110228,"V","Video-Vorlesung","SL",fm1,"COG").
examination(es_fm1__210228,"U","Übung","PNL",fm1,"COG").
module_program("82210","Foundations of Linguistics",fm3,6,"COG").
examination(ep_fm3__101228,"MP","Mündliche Prüfung","PL",fm3,"COG").
examination(es_fm3__111228,"V","Video-Vorlesung","SL",fm3,"COG").
examination(es_fm3__211228,"U","Übung","PNL",fm3,"COG").
module_program("82220","Current Topics in Computational Linguistics 1",am11,6,"COG").
examination(ep_am11__112228,"V1","Vorlesung oder Seminar","PL",am11,"COG").
module_program("82230","Current Topics in Computational Linguistics 2",am12,6,"COG").
examination(ep_am12__113228,"V1","Vorlesung oder Seminar","PL",am12,"COG").
module_program("82240","Current Topics in Machine Learning 1",am21,6,"COG").
examination(ep_am21__114228,"V1","Vorlesung oder Seminar","PL",am21,"COG").
module_program("82250","Current Topics in Machine Learning 2",am22,6,"COG").
examination(ep_am22__115228,"V1","Vorlesung oder Seminar","PL",am22,"COG").
module_program("82260","Project in Computational Linguistics",pm1,12,"COG").
examination(es_pm1__116228,"S","Seminar","PL",pm1,"COG").
module_program("82270","Project in Machine Learning",pm2,12,"COG").
examination(es_pm2__117228,"S","Seminar","PL",pm2,"COG").
module_program("82280","Individual Research Module",im,15,"COG").
examination(ep_im__118228,"PJ","Forschungsprojekt","PL",im,"COG").
module_program("","Master's Thesis",msc,30,"COG").
examination(ep_msc,"","Master's Thesis","PL",msc,"COG").
examination(es_msc,"","Master's Thesis","PL",msc,"COG").

% Custom module sets
set_name(m,"All Modules",4).
set_name(p, "Project Seminars",2).
set_name(o, "Elective Modules",3).
set_name(b, "Mandatory Modules",1).
184 changes: 184 additions & 0 deletions encodings/encoding-examinations.lp
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
% examinations input:
% * in(X,ep)
% * in(X,es)
% * map(ep,M,X)
% * map(es,M,X)
% * in((X,Y),d)

% generate
{ in(E,e(I)) } :- X=(ep;es), in(E,X), I=1..n.

% ee = e(1) U ... U e(n)
in(E,ee) :- in(E,e(I)).

% before(I) = e(1) U ... U e(I)
in(E,before(I)) :- I=1..n, in(E,e(J)), J<=I.

% function f from e(I)'s to s(I)'s
in(M,s(I)) :- in(M,m), I=1..n,
map(ep,M,P), in(X,P),
map(es,M,S), in(Y,S),
in(E,before(I)) : in(E,X);
in(E,before(I)) : in(E,Y);
1 { not in(E,before(I-1)) : in(E,X) ;
not in(E,before(I-1)) : in(E,Y) }.

% s = s(1) U ... U s(n)
in(E,s) :- in(E,s(I)).

% m(w) and m(s)
in(E,m(X)) :- X = (s;w), in(E,m), map(s,E,X).

% constraints (logical connectives)
constraint( if(X,Y)) :- if(X,Y).
constraint( eq(X,Y)) :- eq(X,Y).
constraint(and(X,Y)) :- and(X,Y).
constraint( or(X,Y)) :- or(X,Y).
constraint( neg(X)) :- neg(X).
constraint(exists(A,B,X)) :- exists(A,B,X). % exists some A from B such that X
% % A has to be a unique name occurring in X and nowhere else

% constraints (relations)
constraint( empty(A)) :- empty(A).
constraint(nonempty(A)) :- nonempty(A).
%
constraint( subset(A,B)) :- subset(A,B).
constraint(subseteq(A,B)) :- subseteq(A,B).
constraint( equal(A,B)) :- equal(A,B).
constraint(supseteq(A,B)) :- supseteq(A,B).
constraint( supset(A,B)) :- supset(A,B).
constraint( in'(A,B)) :- in'(A,B). % the set A belongs to the set of sets B
%
constraint( card(A,R,L)) :- card(A,R,L).
constraint(sum(A,M,R,L)) :- sum(A,M,R,L).
%
constraint(notafter(A,B)) :- notafter(A,B). % in the e(I)'s no element of A occurs after some element of B

% statements
st(X) :- constraint(X).
st(X) :- st( if(X,Y)). st(Y) :- st( if(X,Y)).
st(X) :- st( eq(X,Y)). st(Y) :- st( eq(X,Y)).
st(X) :- st(and(X,Y)). st(Y) :- st(and(X,Y)).
st(X) :- st( or(X,Y)). st(Y) :- st( or(X,Y)).
st(X) :- st( neg(X)).
st(X) :- st(exists(A,B,X)).

% additional sets (logical connectives)
set(B) :- st(exists(A,B,X)).

% additional sets (relations)
set(A) :- st( empty(A)).
set(A) :- st(nonempty(A)).
%
set(A) :- st( subset(A,B)). set(B) :- st( subset(A,B)).
set(A) :- st(subseteq(A,B)). set(B) :- st(subseteq(A,B)).
set(A) :- st( equal(A,B)). set(B) :- st( equal(A,B)).
set(A) :- st(supseteq(A,B)). set(B) :- st(supseteq(A,B)).
set(A) :- st( supset(A,B)). set(B) :- st( supset(A,B)).
set(A) :- st( in'(A,B)). set(B) :- st( in'(A,B)).
%
set(A) :- st( card(A,R,X)).
set(A) :- st( sum(A,M,R,X)).
%
set(A) :- st(notafter(A,B)). set(B) :- st(notafter(A,B)).

% additional sets (set operations)
set(A) :- set(int(A,B)). set(B) :- set(int(A,B)).
in(E,int(A,B)) :- set(int(A,B)), in(E,A), in(E,B).
%
set(A) :- set(union(A,B)). set(B) :- set(union(A,B)).
in(E,union(A,B)) :- set(union(A,B)), in(E,A).
in(E,union(A,B)) :- set(union(A,B)), in(E,B).
%
set(A) :- set(expand(A)).
in(F,expand(A)) :- set(expand(A)), in(E,A), in(F,E).
%
set(A) :- set(before(A)). % contains the elements that occur in s(I) before some element of A
in(E,before(A)) :- set(before(A)), in(E,s(I)), in(F,A), in(F,s(J)), I < J.
%
set(A) :- set(after(A)). % contains the elements that occur in s(I) after some element of A
in(E,after(A)) :- set(after(A)), in(E,s(I)), in(F,A), in(F,s(J)), I > J.
%
set(A) :- set(between(A)). % contains the elements that occur in s(I) between some elements of A
in(E,between(A)) :- set(between(A)), in(E,s(I)), in(F,A), in(F,s(J)),
in(G,A), in(G,s(K)), F != G, J <= I, I <= K.


% holds (logical connectives)
holds( if(X,Y)) :- st( if(X,Y)), not holds(X).
holds( if(X,Y)) :- st( if(X,Y)), holds(Y).
holds( eq(X,Y)) :- st( eq(X,Y)), holds(X), holds(Y).
holds( eq(X,Y)) :- st( eq(X,Y)), not holds(X), not holds(Y).
holds(and(X,Y)) :- st(and(X,Y)), holds(X), holds(Y).
holds( or(X,Y)) :- st( or(X,Y)), holds(X).
holds( or(X,Y)) :- st( or(X,Y)), holds(Y).
holds( neg(X)) :- st( neg(X)), not holds(X).
%
{ assign(A,E) : in(E,B) } = 1 :- st(exists(A,B,X)).
in(F,A) :- st(exists(A,B,X)), assign(A,E), in(F,E).
holds(exists(A,B,X)) :- st(exists(A,B,X)), holds(X).

% holds (relations)
holds( empty(A)) :- st( empty(A)), not in(_,A).
holds(nonempty(A)) :- st(nonempty(A)), in(_,A).
%
holds( subset(A,B)) :- st( subset(A,B)), not in(E,A), in(E,B), in(F,B) : in(F,A).
holds(subseteq(A,B)) :- st(subseteq(A,B)), in(E,B) : in(E,A).
holds( equal(A,B)) :- st( equal(A,B)), in(E,A) : in(E,B); in(E,B) : in(E,A).
holds(supseteq(A,B)) :- st(supseteq(A,B)), in(E,A) : in(E,B).
holds( supset(A,B)) :- st( supset(A,B)), in(E,A), not in(E,B), in(F,A) : in(F,B).
holds( in'(A,B)) :- st( in'(A,B)), in(E,B), in(F,A) : in(F,E); in(F,E) : in(F,A).
%
holds(card(A, lt,X)) :- st(card(A, lt,X)), { in(E,A) } < X.
holds(card(A,leq,X)) :- st(card(A,leq,X)), { in(E,A) } <= X.
holds(card(A, eq,X)) :- st(card(A, eq,X)), { in(E,A) } = X.
holds(card(A,geq,X)) :- st(card(A,geq,X)), { in(E,A) } >= X.
holds(card(A, gt,X)) :- st(card(A, gt,X)), { in(E,A) } > X.
holds(card(A, bw,(L,U))) :- st(card(A, bw,(L,U))), L { in(E,A) } U.
%
holds(sum(A,M, lt,X)) :- st(sum(A,M, lt,X)), #sum{ V,E : in(E,A), map(M,E,V) } < X.
holds(sum(A,M,leq,X)) :- st(sum(A,M,leq,X)), #sum{ V,E : in(E,A), map(M,E,V) } <= X.
holds(sum(A,M, eq,X)) :- st(sum(A,M, eq,X)), #sum{ V,E : in(E,A), map(M,E,V) } = X.
holds(sum(A,M,geq,X)) :- st(sum(A,M,geq,X)), #sum{ V,E : in(E,A), map(M,E,V) } >= X.
holds(sum(A,M, gt,X)) :- st(sum(A,M, gt,X)), #sum{ V,E : in(E,A), map(M,E,V) } > X.
holds(sum(A,M, bw,(L,U))) :- st(sum(A,M,bw,(L,U))), L #sum{ V,E : in(E,A), map(M,E,V) } U.
%
holds(notafter(A,B)) :- st(notafter(A,B)), I <= J : in(E,A), in(E,e(I)), in(F,B), in(F,e(J)).

% it cannot be the case that a constraint does not hold
:- constraint(X), not holds(X).
%
% for debugging:
% error(X) :- constraint(X), not holds(X).
% #minimize{ 1,X: error(X) }.
% #show error/1.

% display
%#show.
%#show (E,e(I)) : in(E,e(I)).
%#show (E,s(I)) : in(E,s(I)).
%#show in/2.
%#show _any_opt/1.

% defined
#defined if/2.
#defined eq/2.
#defined and/2.
#defined or/2.
#defined neg/1.
#defined exists/3.
%
#defined empty/1.
#defined nonempty/1.
%
#defined subset/2.
#defined subseteq/2.
#defined equal/2.
#defined supseteq/2.
#defined supset/2.
#defined in'/2.
%
#defined card/3.
#defined sum/4.
%
#defined notafter/2.
Loading