-1
and(A,B) :- A, B.

or(A,_) :- A.
or(_,B) :- B.


error that i am getting is this

compiling C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl for byte code... C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl:10: warning: singleton variables [Expr] for do/2 C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl:11: warning: discontiguous predicate do/3 - clause ignored C:/Users/firoz/OneDrive/Desktop/neww codes/tt.pl compiled, 11 lines read - 2112 bytes written, 7 ms

  • 2
    Did you read the [documentation of GNU prolog](http://www.gprolog.org/manual/html_node/index.html) ? What book did you read about Prolog (in general)? Please notice that **StackOverflow is *not* a do-my-homework website** – Basile Starynkevitch May 04 '21 at 08:57

1 Answers1

3

You are missing a comma in this line:

do(_,_,Expr):- Expr,!,write(true),nl.
jf_
  • 3,099
  • 2
  • 13
  • 31