• Create Account

# Using Lisp (or another language) to generate fictional characters

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

126 replies to this topic

### #61kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 01 November 2003 - 02:40 PM

Ok, I''ve been working with this further today, along the lines as you set forth.

some-person-it-doesnt-really-matter-what-the-symbol-name-is:

I have already pretty much worked on generating the varius aspects of the mother/father. I don''t see the other attributes of "some-person..." as a problem, being somewhat randomly generated, being sure to place limits due to various factors such as parental ethnicity and so forth. However, this one still hangs in my mind:
((instance-of (male-human))

Upon creating this "some-person" does the user provide this or how else does the structure gain this attribute/information about itself?

### #62bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 01 November 2003 - 03:57 PM

quote:
Original post by kordova
I'm still shaky about the "instance/instance-of" concept. I mean, I understand it to some extent, but to use your own example, if a an animal is a race-horse, is it's instance-of member (instance-of (horse)), (instance-of (race-horse)), (instance-of (horse race-horse)) ... ?

Ok, look closely. I'm going to refer to our structures as frames from here on out. The title of a frame is the name of the symbol which is set to the list of elements which follow it. We might have the following frame:

bugs-bunny:((instance-of (cartoon-character))(friends (sylvester tweety foghorn-leghorn yosemite-sam)))

The symbol bugs-bunny is the name of the symbol which is set equal to (use setf) the list which contains two sub lists. Each sublist in the bugs-bunny list contains what is called a slot/value pair. The first slot/value pair is (instance-of (cartoon-character)). The slot is instance-of and the value is (cartoon-character). We put cartoon-character in a list, because some slots allow multiple entries, and we can see that in action in the next slot/value pair, where we have four values for the slot friends. Ok, so we now know how to structure our frames, and what a slot is, and what a value is. Now, forget about bugs-bunny, and lets move on to understanding instances.

Look at the following frames:

horse:((sub-category-of (mammal))(categories (race-horse draft-horse thoroughbred quarter-horse)))mammal:((sub-category-of (animal))(categories (horse dog cat human gorilla tiger)))animal:((sub-category-of (living-thing))(categories (mammals reptiles fish insects circus-animals)))race-horse:((sub-category-of (horse))(instances (secretariat seabiscuit spectacular-bid ruffian)))secretariat:((instance-of (race-horse thoroughbred)))

Now, notice that secretariat is an instance-of both a race-horse and a thoroughbred. That's perfectly valid. Also, it is also true that secretariat is also an (instance-of (horse mammal animal living-thing)) among others. We could cache these values on the secretariat frame if we wanted to. We would get this:

secretariat:((instance-of (race-horse thoroughbred horse mammal animal living-thing)))

For high speed retrieval, caching is better. But we can write code to make these determinations even if we don't cache it. The rule goes like this:

If something is an instance-of a category, then it is also an instance-of everything that the named category is a sub-category of.

An semi ideal solution is to have a piece of code be run once, at assertion time, to determine everything which secretariat is an instance-of, and then cache those values. It gets a little complex though. That's because if we've already created the secretariat frame, and later declare that living-thing is a sub-category-of of physical-thing, then for completeness, we must percolate through our entries and update the secretariat frame to now mention that secretariat is an instance-of physical-thing. This is absolutely necessary if at query time we only rely on cached values.

Obviously, we're digressing from the main thrust of this thread, and delving into the realms of truth maintenance and knowledge bases, but it is all relevant, and allows for some rather amazing generalizations to be made with regard to knowledge, and also it allows for using the knowledge in the knowledge base itself to enforce semantics. The real payoff is where the simple mention of one little fact actually creates a cascade of facts, creating real knowledge and supposed understanding and comprehension.

It kind of boils down to this: If I told you Citation was a race horse, you'd actually know a heck of a lot about Citation, certainly a great deal more than the simple fact that Citation is a race horse.

[edited by - bishop_pass on November 1, 2003 11:43:51 PM]

### #63Neoshaman  Members   -  Reputation: 170

Like
Likes
Like

Posted 01 November 2003 - 04:34 PM

instance are the leaf of the semantic tree
every thing above are abstract branch of the tree
instance are ''concrete''

he work better on a picture but i did not have time

>>>>>>>>>>>>>>>
be good
be evil
but do it WELL
>>>>>>>>>>>>>>>

### #64kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 02 November 2003 - 06:16 PM

(Yar, I still think three pages deep into the lounge is no place for this thread... that aside...)

I've finished the prototype "bassert" function. I didn't want to use assert as I think it may be defined elsewhere and I wrote a far less exciting BAssert in C++ once.

In any event, here's what is going on, after hours of beating my head on the desk tonight until I found my salvation in the form of
symbol-value

>(setf will '())NIL>willNIL>(bassert '(name "Will" will))("Will")>will(NAME ("Will"))>(bassert '(name "William" will))("William" "Will")>will(NAME ("William" "Will"))>(bassert '(age 26 will))(26)>will(AGE (26) NAME ("William" "Will"))

While I'm still internally tackling the mechanics of the system on a higher level, I need to implement a way to only append to existing lists if that given attribute should be appended to, as obviously things like last name, proper first name and age won't have multiple entries. Cheers.

[edited by - kordova on November 3, 2003 1:19:07 AM]

### #65flangazor  Members   -  Reputation: 516

Like
Likes
Like

Posted 03 November 2003 - 01:03 AM

quote:
Original post by bishop_pass
quote:
Original post by flangazor
Unless you can interact with the character (directly or indirectly) in question there is, in my opinion:

a.) little point
b.) not much going on of interest

While the history might supplement a more in depth character system, when it is alone it is not all that intriguing.

Comically, writing it in Lisp wouldn''t be much effort except for the tables of information you wish to select from (names, ethnicities, diseases, occupations, etc).
Your take on the subject, as well as Oluseyi''s, is that the end result is a list of traits articulated into a set of sentences. That''s rather dull, isn''t it? It seems you have chosen to conclude the matter, rather than explore it.

I myself think the subject at hand here dovetails nicely with my other thread, and in fact, the efforts here could serve as inputs to narratives generated by an application such as that envisioned in the other thread.

What is different from what you have proposed and selecting random fields from a database and heuristically linking them together?

I am still not sure which part is so interesting. The idea that you can set up a symbolic database and create dynamic entries, or the heuristic algorithms to generate the versimilitude.

It is entirely possible it hasn''t grokked with me.

### #66bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 03 November 2003 - 02:50 AM

quote:
Original post by flangazor
The idea that you can set up a symbolic database and create dynamic entries, or the heuristic algorithms to generate the versimilitude.
I would think it would be that verisimilitude.

### #67bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 03 November 2003 - 02:53 AM

quote:
Original post by kordova
>will  (AGE (26) NAME ("William" "Will"))

That looks pretty good, but I''d format each slot/value pair to be a list, like this:

((AGE (26)) ((NAME ("William" "Will")))

### #68kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 03 November 2003 - 05:28 AM

That's what I had originally done, though I found I couldn't use setf on my own defined getf, and decided to use property lists for the time being. I'll work on that next.

EDIT: Ok, got it.

[edited by - kordova on November 3, 2003 2:17:15 PM]

### #69kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 05 November 2003 - 08:17 AM

Would it be advisable to write a sort of utility function such as:
(create-instance symbol-name symbol-category)
for use that would, in the least, define the
instance-of
sub list of
symbol-name
? I find this reasonable in that at instantiation, all other categories can be found and appended to the instance-of list, and also so that you couldn't create a list, append a slot to it and then add it's instance-of member that would make the former slot illegal.

[edited by - kordova on November 5, 2003 3:18:17 PM]

### #70bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 05 November 2003 - 04:30 PM

Sorry, I''m not totally following you. I''m a little tired today. Could you provide an example, especially regarding something being legal or illegal?

### #71kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 05 November 2003 - 04:37 PM

I have the tendency of, well, not speaking english.

My concern is that someone might do something like this:
(setf some-guy ''())SOME-GUY(bassert ''(power-source triple-a some-guy))((POWER-SOURCE (TRIPLE-A)))(bassert ''(instance-of human-male some-guy))((INSTANCE-OF (HUMAN-MALE))(POWER-SOURCE (TRIPLE-A))); now here define the human-male category, which does not, nor will it likely ever, define a subslot of type power-source.
This is all under the assumption that the categories, subcategories and slots must be defined before adding the same to a frame/structure.

### #72bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 05 November 2003 - 04:50 PM

Well, doesn''t bassert automatically make the additional assertion that power-source makes-sense-for human-male once some-guy is said to be an instance-of human-male?

No?

Probably not. bassert should deny the right to make some-guy an instance-of human-male when you attempt to assert it, because he has the slot power-source on him.

Let''s assume that we already had a frame for the slot power-source.

power-source:instance-of: slotmakes-sense-for: powered-objects

Now, given that, as soon as one asserts that some-guy has a power-source, the bassert function then looks up the info for the power-source slot, determines that the power-source slot is indeed an instance-of slot (it had better be) and that it makes-sense-for powered-objects, thus bassert then asserts that some-guy is an instance-of powered-objects, and assuming that we have defined powered-objects to be mutually disjoint from living-things, then obviously, when we attempt to assert that some-guy is an instance-of human-male, it will deny that, unless human-male is not yet defined. Let''s say that it is not yet defined. Then, of course, when we ultimately try and declare that human-male is a sub-category of living-thing, it should deny that.

So, in the beginning, you want to bootstrap the knowledge base with enough meta-info and common sense to disallow such things. It''s possible.

### #73kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 05 November 2003 - 05:08 PM

quote:
Original post by bishop_pass
So, in the beginning, you want to bootstrap the knowledge base with enough meta-info and common sense to disallow such things. It's possible.

Ok, that's where I reasoned that you stood. My other question is whether bassert should only allow slots to be added to existing structures (which will do all the necessary checks to make certain no illegal entries) and add a separate instantiation function taking the name and type. This would force a distinction between making and modifying which seems to me to have some benefits.

[edited by - kordova on November 5, 2003 12:11:28 AM]

### #74bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 05 November 2003 - 05:24 PM

quote:
Original post by kordova
quote:
Original post by bishop_pass
So, in the beginning, you want to bootstrap the knowledge base with enough meta-info and common sense to disallow such things. It''s possible.

Ok, that''s where I reasoned that you stood. My other question is whether bassert should only allow slots to be added to existing structures (which will do all the necessary checks to make certain no illegal entries) and add a separate instantiation function taking the name and type. This would force a distinction between making and modifying which seems to me to have some benefits.
Either way. Your preference would appear to be in part motivated by a desire for less errors. Certainly, you don''t want a typo to cause a new frame to be made when you meant an existing one.

I hope you have (and it appears that you have) caught on to the subtlety that slots are also frames, and part of a hierarchy themselves.

For example, instance-of is a frame, and it looks like this:

instance-of:((instance-of (slot))(makes-sense-for (thing))(inverse (instances)))

So, given that info, we see that when we assert:
(instance-of human-male bob)

assert looks up the frame for instance-of and sees that the inverse is instances, and automatically asserts the inverse relation, that being:
(instances bob human-male)

Also, bob must be an instance-of thing for the slot instance-of to reside on the bob frame, this following from the fact that instance-of makes-sense-for thing.

And lastly, the context under which we use instance-of is to to be a slot on another frame, and that''s why instance-of is an instance-of slot, as opposed to something else, like a frog.

### #75kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 09 November 2003 - 08:00 AM

Here's what I've got (in terms of utility functions) for the time being:

A. (define-slot '((this-makes-sense-for) this-number-of-entries object))result: object: ((instance-of (slot)) (makes-sense-for (this-makes-sense-for)) (number-of-entries (this-number-of-entries)))

Details:
1. The parameter number-of-entries can be zero, a positive number or the symbol any.
2. The this-makes-sense-for field is in a list so that a slot may be defined with reusability in mind (something such as a name for example could and would be used just as readily be a person as by a horse).

B. (instantiate '(this-category object))result: object: ((instance-of (this-category)))

Details:
1. This function also appends object to the (instances) field of this-category.

C. (define-category '(this-sub-category-of object))result: object: ((sub-category-of (this-sub-category-of)))

Details:
1. This function also appends object to the (sub-categories) field of this-sub-category-of.

D. (b-assert '(slot value object) &optional overwrite-existing-value)result: object: ((EXISTING-SLOT (EXISTING-VALUE) (slot (value)))

Details:
1. If slot-makes-sense-for object, either:
a. (slot (value)) is added if an instance of it didn't exist beforehand.
b. value is appened to the existing value list if there is room.
c. value overwrites any existing value for the slot.

[edited by - kordova on November 9, 2003 3:03:47 PM]

### #76bishop_pass  Members   -  Reputation: 100

Like
Likes
Like

Posted 09 November 2003 - 03:07 PM

That''s all looking pretty good so far. Have you read about Douglas Lenat''s EURISKO program or RLL, which is a Representation Language Language?

### #77kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 09 November 2003 - 03:15 PM

quote:
Original post by bishop_pass
That''s all looking pretty good so far. Have you read about Douglas Lenat''s EURISKO program or RLL, which is a Representation Language Language?

I definitely have not. I''ll have to look into it.

### #78Neoshaman  Members   -  Reputation: 170

Like
Likes
Like

Posted 09 November 2003 - 03:21 PM

there is no link related to, too??

>>>>>>>>>>>>>>>
be good
be evil
but do it WELL
>>>>>>>>>>>>>>>

### #79kordova  Members   -  Reputation: 138

Like
Likes
Like

Posted 09 November 2003 - 03:23 PM

quote:
Original post by Neoshaman
there is no link related to, too??

Nice to see that you''re paying attention to the threads, shaman. I don''t see any books on the topic but I''ll share a link if I find a particularly good one with my pal google.

### #80Neoshaman  Members   -  Reputation: 170

Like
Likes
Like

Posted 09 November 2003 - 03:42 PM

yep i''m still paying attention but i have some overflow because of high level abstract english, remember i''mn''t a programmer at the basis, i have a flexible mind but i reach some limits
i think some post around this period may look like a little puzzle because my mind is puzzle because of the large amount of data i have take from 3 mouth since i have begin this project
and the fact i understand not that easy english and could not use it subtlety is hard for myself

i have start study the case with my cinema teacher in my artschool to see if there something i could borrow for academic storywritings

i have to synchronize too what i know about semantice s and how i use them with the work done is programmation and the kind, i have use until now empirical thoughts build with memory of some article i have read once, then...

don''t pay to much attention if some of my post are a little inacurate, i''m still learning english and after re-read twice both thread it seems that i did misunderstood some post, i would re-read more, i would seek for academics resherch on that field, i have once read about a project called TALESPUN which would answer the topic about interlude

>>>>>>>>>>>>>>>
be good
be evil
but do it WELL
>>>>>>>>>>>>>>>

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS