Questions tagged as 'prolog'

0
answers

odbc database query with prolog

I have a problem with my query, they ask me to define a predicate that receives as parameter a SQL String with the query to execute and that returns the result R, of the same one making use of the predefined predicate odbc_query/3. Try to...
asked by 21.09.2018 / 18:48
1
answer

Problems with lists -Prolog-

I have a problem with an exercise of prolog , which is to construct a predicate that given an atom a as the first argument, a second atom s as the second argument, is unified to a third parameter L , which contains a set of...
asked by 17.07.2018 / 23:06
1
answer

Count how many times a node is repeated in prolog

connection (d, h, 4). connection (h, f, 9). connection (i, f, 11). connection (f, g, 10). connection (f, a, 8). connection (a, b, 7). hasArray (X): -connection (X, , ). I want to know for example this code tells me that f is repeated 2 tim...
asked by 12.06.2018 / 06:02
0
answers

Avoid "redo" in Ciao Prolog

I have a problem running a simple program in Ciao Prolog and it is that when a predicate is running there is a point where it makes a "fail" (which I hope) and after that it does a "redo" and goes back in the execution instead of jumping to the...
asked by 02.05.2018 / 00:46
1
answer

Find items from a list in another prolog

Good I am working in a drug recommender in which I have a list of medicines and another with allergies, a fact contains (medicine, component) where X medicine contains Y component and another that is has_allergy (patient, component_allergic) whe...
asked by 25.02.2018 / 14:06
1
answer

Add branches in prolog [closed]

Hi, I am a beginner in prolog and I am a student on ternary trees. I have been trying to solve the following exercise for some time Go deep into a ternary tree and calculate the sum of each branch from the root to a leaf     
asked by 04.12.2017 / 08:01
1
answer

Problem Calling Prolog from Php

I'm new to this forum and a little bit with the Prolog programming language. I am currently working on a project based on an Expert System with web interface, using SWI-Prolog, based on a contribution made in another forum ( link ) that talks ab...
asked by 02.10.2017 / 00:29
1
answer

Prolog and facts in the database

Good morning, I'm learning prolog and I have some questions for you. I want to know more about how these problems are made more than the final answer since my intention is to learn and not solve the exercise directly. My question is I ha...
asked by 09.06.2017 / 20:31
1
answer

How to join 2 elements of a list in prolog

I have 2 lists. strong_price ([100,110,95,90]). plato_fuerte ([filete_de_cerdo, fillet_of_fish, pollo_asado, meatloaf]). What I want to do is a query that when you enter one of the dishes you also see its price     
asked by 30.05.2017 / 04:39
1
answer

Check for words with Latin letters in the string

I need to check if there are words in the string with Latin letters. For example, I enter a string in another language: Enter the string: ыкеыу ролdfgdгп тми ваы The answer would be: Words with latin letters: ролdfgdгп This...
asked by 25.05.2017 / 09:39