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

tau-prolog output is terrible #349

Open
antraxsec opened this issue Mar 25, 2023 · 2 comments
Open

tau-prolog output is terrible #349

antraxsec opened this issue Mar 25, 2023 · 2 comments

Comments

@antraxsec
Copy link

CODE PL

`:- use_module(library(lists)).

% Hechos: Problemas y sus síntomas
problema(no_enciende, "Verificar la conexión de la fuente de poder y el cable de alimentación.").
problema(no_arranca_pantalla_azul, "Verificar el estado del disco duro y la memoria RAM.").
problema(no_se_conecta_a_internet, "Verificar la configuración de la red y la conexión del cable de red.").
problema(sobrecalentamiento, "Limpiar el polvo y verificar el funcionamiento del ventilador del procesador.").
problema(bajo_rendimiento, "Realizar un análisis de malware y optimizar el sistema operativo.").

% Reglas: Diagnóstico de problemas según los síntomas reportados
diagnosticar_problema(Sintomas, Solucion) :- problema(Id, Solucion), forall(member(Sintoma, Sintomas), sintoma_de_problema(Sintoma, Id)).

% Hechos: Síntomas y su relación con los problemas
sintoma_de_problema("no enciende", no_enciende).
sintoma_de_problema("no arranca", no_arranca_pantalla_azul).
sintoma_de_problema("pantalla azul", no_arranca_pantalla_azul).
sintoma_de_problema("no se conecta a internet", no_se_conecta_a_internet).
sintoma_de_problema("sobrecalentamiento", sobrecalentamiento).
sintoma_de_problema("bajo rendimiento", bajo_rendimiento).

% agregar nuevos problemas y soluciones
% problema(lentitud_al_navegar, "Verificar la velocidad de la conexión a internet y limpiar el caché del navegador.").
% sintoma_de_problema("lentitud al navegar", lentitud_al_navegar).

% Ejemplo de uso
% ?- diagnosticar_problema(["no arranca", "pantalla azul"], Solucion).`

QUERY
session.query(diagnosticar_problema(("no arranca", "pantalla azul"), Solucion)., { ...

OUTPUT IS

Solucion = [V,e,r,i,f,i,c,a,r, ,l,a, ,c,o,n,e,x,i,ó,n, ,d,e, ,l,a, ,f,u,e,n,t,e, ,d,e, ,p,o,d,e,r, ,y, ,e,l, ,c,a,b,l,e, ,d,e, ,a,l,i,m,e,n,t,a,c,i,ó,n,.]

@triska
Copy link

triska commented Mar 26, 2023

This is already filed as #304.

@antraxsec
Copy link
Author

Esto ya está archivado como #304 .
It worked thanks! A great query is there any way to have the response in json format some other format to iterate it in javascript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants