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

Dev #7

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
8e27d9b
First commit test script
Mar 10, 2025
6c6d620
Adding syntax for common knowledge.
Mar 10, 2025
dd920a7
Json reader: [add states]
Mar 10, 2025
66cc2a1
Complete model from JSON
Mar 10, 2025
df1a63b
Añadir meter el modelo como un json.
Mar 10, 2025
6a0d997
Implemented transitivity closure.
Mar 10, 2025
5e1a6e9
Group closure
Mar 10, 2025
87f8f27
1st try common knowledge.
Mar 10, 2025
49fe8f9
fork
Mar 11, 2025
616a308
checkout
Mar 11, 2025
c5e08e6
mer. 12 mars 2025 17:43:15 CET
Mar 12, 2025
ef77b69
updateModel function
Mar 13, 2025
0de47cd
jeu. 13 mars 2025 16:57:31 CET
Mar 13, 2025
679b727
updateModelGraph
Mar 13, 2025
b51330b
new feat. input model as a file
Mar 13, 2025
e4bf663
ven. 14 mars 2025 12:53:31 CET
Mar 14, 2025
e5d8bfc
ven. 14 mars 2025 14:01:16 CET
Mar 14, 2025
973f865
Fix commong knowledge
Mar 18, 2025
b567d22
fix common and distributed model
Mar 19, 2025
4b4c04f
clean logs
Mar 19, 2025
1df3145
readme + web
Mar 19, 2025
fd4208f
Merge branch 'dev'
Mar 19, 2025
d33f29f
Add condition to actual world
Mar 21, 2025
13117e1
Merge branch 'master' of github.com:cagve/epistemicmodallogic into test
Mar 21, 2025
703eeff
subformula function
Mar 24, 2025
19454d3
[web feat] add dynamic radios for subformulae
Mar 24, 2025
1dc4205
Mon Mar 24 18:02:43 CET 2025
Mar 24, 2025
723046a
Merge branch 'dev' of github.com:cagve/epistemicmodallogic into dev
Mar 24, 2025
df10c38
[feat] subformulas debug
Mar 24, 2025
e473461
[imp] use unicode to subformulas
Mar 25, 2025
8a93ff3
[feat] subformulae dropdown menu
Mar 25, 2025
28fbcbb
[feat] see common arrows
Mar 28, 2025
f139f3a
[feat] show dist relations
Mar 28, 2025
bef72d6
Merge branch 'test' of github.com:cagve/epistemicmodallogic into test
Mar 28, 2025
133327b
merge
Mar 28, 2025
8a0f046
2025-03-28T21:27:38Z
Mar 28, 2025
72e855c
not showing link
Mar 30, 2025
b33779a
not showing links
Mar 30, 2025
8f66fe7
2025-03-30T17:13:32Z
Mar 30, 2025
c219cdb
Sun Mar 30 07:16:04 PM CEST 2025
Mar 30, 2025
8bc9c6f
[FEAT] setLinkAgent function
Mar 30, 2025
e1f7fa9
[FEAT] arrow's angle = 0 for g and h
Apr 2, 2025
25ff714
add buttons
Apr 2, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/*
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
Epistemic Logic Playground
Epistemic Logic Playground(FORK for T4TL)
======================
This project is based on the open-source <a href="http://rkirsling.github.io/modallogic/">Modal Logic Playground</a> by <a href="https://github.com/rkirsling">Ross Kirsling</a>.
The Epistemic Logic Playground was made by <a href="https://elliot.website">Elliot Evans</a>.
Special thanks to my non-classical logic instructors Richard Zach and Audrey Yap, as well
as my classmates who provided feedback on this project.

This project is based on the open-source <a href="http://rkirsling.github.io/modallogic/">Epistemic Logic Playground</a> by <a href="https://github.com/vezwork/">Elliot vezwork
</a> and <a href="http://rkirsling.github.io/modallogic/">Modal Logic Playground</a> by <a href="https://github.com/rkirsling">Ross Kirsling</a>.

The Epistemic Logic Playground is a graphical semantic calculator for Dynamic Epistemic logic, built using [D3](http://d3js.org/), [MathJax](http://www.mathjax.org/), and [Bootstrap](http://getbootstrap.com/).

See it in action at [vezwork.github.io/modallogic](https://vezwork.github.io/modallogic)!
See it in action at [epistemicmodallogic](https://cagve.github.io/epistemicmodallogic/?model=;AS?formula=)

### Reusable code
* The core part of the code is MPL.js, a library for parsing and evaluating well-formed formulas of modal propositional logic. See the API Reference [here](API-Reference.md).
* I've also extracted the directed graph editing code so that it can be easily repurposed. You can find it [here](http://bl.ocks.org/rkirsling/5001347).
94 changes: 94 additions & 0 deletions \
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@

// When the button is clicked.
document.getElementById('readFileButton').addEventListener('click', function() {
document.getElementById('fileInput').click();
});

//
document.getElementById('fileInput').addEventListener('change', function(event) {
const file = event.target.files[0]; // Obtiene el archivo seleccionado

if (file) {
const reader = new FileReader();

reader.onload = function(e) {
updateModel(e.target.result); //TODO parser
};

reader.onerror = function(e) {
console.error("Error al leer el archivo:", e.target.error);
};

reader.readAsText(file);
} else {
console.log("No se seleccionó ningún archivo.");
}
});


function addText(conector, element=null) {
var text = document.getElementById('formulaInput');

text.focus();
if (conector === "delete"){
text.value = '';
return;
}else{
text.value += conector;
}
if (element===null){
return
}
const className = element.className;

let styleScript = document.getElementById('button-style');
if (!styleScript) {
styleScript = document.createElement('style');
styleScript.id = 'button-style'; // Asigna el id
document.head.appendChild(styleScript);
}

switch(className){
case "atom-button":
hide = ["atom-button", "monadic-button", "modal-button", "agent-button"]
show = ["diadic-button"]
break;
case "monadic-button":
hide = ["diadic-button","agent-button"]
show = ["monadic-button", "atom-button", "modal-button"]
break;
case "modal-button":
hide = ["diadic-button"]
show = ["monadic-button", "atom-button", "modal-button"]
break;
case "group-button":
hide = ["monadic-button", "atom-button", "modal-button", "diadic-button"]
show = ["agent-button"]
break;
case "agent-button":
hide = ["diadic-button"]
show = ["agent-button", "monadic-button", "atom-button", "modal-button"]
break;
case "diadic-button":
hide = ["diadic-button"]
show = ["monadic-button", "atom-button", "modal-button"]
break;
}

styleScript.innerHTML = ''; // Elimina todas las reglas CSS previas
applyStyles(show, hide);
}




// Función para aplicar los estilos (mostrar/ocultar los botones)
function applyStyles(show, hide) {
let styleScript = document.getElementById('button-style');
hide.forEach(clase => {
styleScript.innerHTML += `.${clase} { display:none; }`;
});
show.forEach(clase => {
styleScript.innerHTML += `.${clase} { display:inline; }`;
});
}
Loading