is_vocab/1 (BB: Exercise 1.1.2) – Verständnis
Devise a simple Prolog notation for representing vocabularies (for example, use Prolog lists in place of the curly-brackets and ordered pairs). Write a predicate is_vocab/1
which checks that something written in your notation really is a first-order vocabulary. For example, it should check that each symbol is associated with a number giving its arity, and that no symbol is used in two different ways.
Hint 1: test your predicate on one of the following lines, depending on the vocabulary notation you have chosen.
Hint 2: you may use integer/1
, atom/1
, member/2
and not/1
Klicke auf den „weiter“-Button am Ende der Seite um deinen Code zu Implementieren und zu Testen.