Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

Recent questions tagged prolog

0 votes
1.5k views
1 answer
    When i do an assert like: assert(-color(red)). it gives me the error: ERROR: assert/1: No permission to ... expected, found `-color' Any ideas? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
707 views
1 answer
    This is a test review question that I am having trouble with. How do you write a method to evaluate an algebraic ... sure how to go about this. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
420 views
1 answer
    To grok green cuts in Prolog I am trying to add them to the standard definition of sum in successor arithmetics ( ... green cuts? If yes, how? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
842 views
1 answer
    i have this code that converts integers into roman numerals i need to add a function that compares an integer with a ... (N) :- toroman(N). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
506 views
1 answer
    During my implementation of the Adventure game in Prolog I was wondering when the redo-port is called with new ... for offering any clarity. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
675 views
1 answer
    I need to filter the list [#,d,e,#,f,g] such that I get the output as [[d,e],[f,g]] , I am stuck ... ), filterL(Tail,List) ; filterL(Tail,X) ). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
507 views
1 answer
    I'm trying to understand the semicolon functionality. I have this code: del(X,[X|Rest],Rest). del(X,[Y|Tail] ... that to me? Thanks in advance. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
402 views
1 answer
    Currently I can generate expression trees. expression_tree([_|N_s],N_s, [number(0)]). expression_tree([_|N_s0 ... (FD) and multiple constraints See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
631 views
1 answer
    I have build a code in prolog to find a series of legal moves in which the knight lands on each square ... way of solving this problem? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
872 views
1 answer
    As a Prolog newbie, I try to define a predicate filter_min/2 which takes two lists to determine if the second list is ... ,Z); filter(T1,T2,Z). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
623 views
1 answer
    I'm trying to do the Towers of Hanoi problem, what I have tried so far: move(1,[H|T],B,C,A1,B1,C) :- A1 = ... A1), nl, write(B1), nl, write(C). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
603 views
1 answer
    I am writing a solution to working out distances between numbers in a list using recursion, but have been struggling with ... ,7],[5],[]]. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
679 views
1 answer
    im trying to write a program in prolog that determine if there is a way from place to place. these are the ... Stack Full". someone? thank you See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.0k views
1 answer
    I need to define divide so that List [1,2,3,4,5] divides into: a = [1,2,3} b = [4,5] I'm getting an error ... ; divide(T, L2, append(L3,H,Y)) ). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
574 views
1 answer
    I read a brief article about Prolog and Logic Programming. I'm curious if Logic Programs can do algebra. Like would ... get an answer of -2? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
469 views
1 answer
    In Art of Prolog of Sterling & Shapiro, exercise Section 14.1 (v): queens(N,Qs) :- length(Qs,N), place_queens(N,Qs ... is N+1, attack(X,N1,Ys). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
451 views
1 answer
    In Art of Prolog of Sterling & Shapiro, exercise Section 14.1 (v): queens(N,Qs) :- length(Qs,N), place_queens(N,Qs ... is N+1, attack(X,N1,Ys). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
1.4k views
1 answer
    I'm writing a program in prolog that count the number of occurrences of a number in a list count([],X ... several times Any help is appreciated See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
681 views
1 answer
    So as part of my work my code needs to print all the solutions to a query but without using the findall/3 ... press ; and without using findall. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
467 views
1 answer
    I implemented Einstein Riddle in Prolog and I'm trying to find out who had a fish at home. I can' ... structures in helper predicates aswell. See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
433 views
1 answer
    I am doing some easy exercises to get a feel for the language. is_list([]). is_list([_|_]). my_flatten([],[] ... am I intended to use if_ here? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
449 views
1 answer
    The following higher order predicate succeeds if all pairs of the list's elements are true for a given ... between pairwise distinct and unique See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
602 views
1 answer
    Am writing a logic program for kth_largest(Xs,K) that implements the linear algorithm for finding the kth largest element ... select(X,Ys,Zs). See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
475 views
1 answer
    Assume I have the following DCG rule: factor(X) --> "(", expr(X), ")". Normally this would be translated to ... , 2012 N238 DIN Draft 2012-11-20 See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
512 views
1 answer
    memberchk/2 is a commonly defined predicate that is defined in terms of member/2 like so: memberchk(X, Xs) ... cannot be replaced by memberd/2? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
444 views
1 answer
    I remember once reading that there were at least two other alternatives invented roughly at the same time as the WAM. Any pointers? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
599 views
1 answer
    Without thinking to much, it seems to me that a large set of Prolog's functionality could be implemented ... convert Prolog to SQL? See Question&Answers more detail:os...
asked Oct 24, 2021 in Technique[技术] by 深蓝 (71.8m points)
0 votes
758 views
1 answer
    I have a list of lists, and I need to find the longest one of them. If there are more than one with the ... s the same which it returns. Thanks. See Question&Answers more detail:os...
asked Oct 17, 2021 in Technique[技术] by 深蓝 (71.8m points)
Ask a question:
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...