You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that Avatar Logic is capable of capturing nuances that otherwise might be hard to reason about:
Most countries have a distinct city as capital
Some countries have themselves as capital (e.g. Luxembourg)
Some countries have multiple capitals (e.g. South-Africa)
When a country has a capital, the capital has the country, but by using pairs one can automatically get "is" when possible in addition to "has":
(X, Y) :- (Y, X), Y : country, X : capital.
When a distinct city is a capital, I use the role:
<city> : capital
When a country has itself as capital:
uniq capital
capital'(<city>) : capital
This does not collide with capital as a role, because capital(x) does not imply a unique value. It is the pair (x, capital'(y)) which implies a unique value.
When a country has multiple capitals, I use another non-unique 1-avatar capitals:
capitals'(<city>) : capital
There is also a country (Switzerland) that claims to have no capital, but which has a "de facto" capital. One can use a unique 1-avatar de_facto_capital'(<capital>) such that capital(<country>) = de_facto_capital'(<capital>) but not capital(<country>) = <capital>. However, (<capital>, <country>) works by lifting out of the 1-avatar:
uniq de_facto_capital
(X, Y) :- (de_facto_capital'(X), Y), Y : country.
When two countries claim the same capital, one can use a non-unique 1-avatar territory'(<country>) with a lifting of the equality, not the pair, to make capital(<country>) substitute with the capital:
capital(X) = Y :- capital(territory'(X)) = Y.
The text was updated successfully, but these errors were encountered:
I find that Avatar Logic is capable of capturing nuances that otherwise might be hard to reason about:
When a country has a capital, the capital has the country, but by using pairs one can automatically get "is" when possible in addition to "has":
When a distinct city is a capital, I use the role:
When a country has itself as capital:
This does not collide with
capital
as a role, becausecapital(x)
does not imply a unique value. It is the pair(x, capital'(y))
which implies a unique value.When a country has multiple capitals, I use another non-unique 1-avatar
capitals
:There is also a country (Switzerland) that claims to have no capital, but which has a "de facto" capital. One can use a unique 1-avatar
de_facto_capital'(<capital>)
such thatcapital(<country>) = de_facto_capital'(<capital>)
but notcapital(<country>) = <capital>
. However,(<capital>, <country>)
works by lifting out of the 1-avatar:When two countries claim the same capital, one can use a non-unique 1-avatar
territory'(<country>)
with a lifting of the equality, not the pair, to makecapital(<country>)
substitute with the capital:The text was updated successfully, but these errors were encountered: