Not logged in. · Lost password · Register

Member since Oct 2019
11 posts
Subject: Empty tree in problem 3.2
Unfortunately I don't quite understand how the empty tree with no nodes should be represented in the definition of trees in problem 3.2, for reference:

istree(tree(Value,Children)) :− string(Value),subtrees(Children).
subtrees([(Cost,T)|Rest]) :− number(Cost),istree(T), subtrees(Rest).

Can anyone help?
Member since Oct 2019
86 posts
You can make a tree with just the root node "A" and no children like this:
I hope this helps.

You can check out more examples in the notebook:
Since Swish is being particularly unreliable this year, I'll also post the code from the notebook to
This post was edited on 2019-11-11, 11:14 by katjab.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Datenschutz | Kontakt
Powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2011 by Yves Goergen