Questions tagged [prolog-assert]

Prolog-assert globally affects stored information in Prolog, a general purpose logic programming language.

Source: http://alumni.cs.ucr.edu/~vladimir/cs171/prolog_2.pdf

Prolog assert(X) Adds a new fact or clause to the database. Term is asserted as the last fact or clause with the same key predicate.

47 questions
0
votes
1 answer

How to enter all results of this rule as facts in the program or how can I process these results as facts?

%Examples %course_meetings(maths4,tutorial,t07,khaled_mohamed,'tutorial for t07') %days([sat,sun...]) %tutorialrooms([c6301,b4108,c2201,c2301,c2202,c2203]) %slots([1,2,3,4,5]) day_tut(Day,Slot,Place,Course,Group,Instr,Descr):- …
M.K
  • 179
  • 1
  • 2
  • 10
-1
votes
4 answers

Factorial calculation without using recursion

I'm trying to implement a solution for the factorial calculation (n!) without using recursion, only using the retroaction of prolog. For example: factorial(0, 1). factorial(1, 1). factorial(2, 2). retroaction(X, Y) :- factorial(K, Y), not(K =…
rwehresmann
  • 1,108
  • 2
  • 11
  • 27
1 2 3
4