r/prolog • • Jun 11 '20

Brain Teaser

anyone know how to instantiate these:

[3,X] = [ ... , ...]. 

output:

X=3, Y=[3].

=====================================

g(f[a],X,b) = g(... , X).

output:

X=b, Y=[a].

=====================================

output:

X=h(b), Y=h(a,h(b)), Z=g(g,c).

1 Upvotes

4 comments sorted by

5

u/slaphead99 Jun 12 '20

Come on. You need to do much better at explaining what it is exactly that you want.

4

u/authorblues Jun 12 '20

If they could explain it better, they wouldn't need you to do their homework for them.

4

u/slaphead99 Jun 12 '20

It’s laziness not lack of ability.

1

u/Bear8642 Jun 12 '20
g(f[a],X,b) = g(... , X).

sure not

g([a],X,b) = g(... , X).

easy if so