-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstyle_interviews.pl
executable file
·128 lines (110 loc) · 3.96 KB
/
style_interviews.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* :- compile(library(sets)). */
/* alter attributes list, alter validentity predicates */
:- multifile(typeschema/6).
:- multifile(informalnames/2).
:- multifile(validentity/2).
:- multifile(style/2).
style(interviews, 'Stanford InterViews').
/* Check constraints on an entity */
/* validentity(entity(style), name of entity) */
/* NOTE: IN ALL CASES WHERE THE DATABASE IS CHECKED FOR AN ATTRIBUTE,
MAKE SURE TO ALLOW FOR POSSIBILITY THAT THE ATTRIBUTE WAS NOT
ENTERED BY THE USER (A PARTIAL DESCRIPTION)!*/
validentity(event(interviews), Name) :-
indatabase([Name]),
validentity(datacomponent(base), Name),
(member(Name, [xevent_keypress, xevent_keyrelease, xevent_buttonpress]) ->
true;
zz('Unrecognized OBST event', Name, Name)
).
validentity(controlcomponent(interviews), Name) :-
indatabase([Name]),
validentity(controlcomponent(base), Name).
validentity(object(interviews), Name) :-
indatabase([Name]),
validentity(object(base), Name).
validentity(trigger(interviews), Name) :-
indatabase([Name]),
validentity(trigger(base), Name),
getvalues(trigger, _, Name,
[object, inmessage, outmessageset, outcalls, outspawns],
[Object, Inmessage, Outmessageset, Outcalls, Outspawns]),
checkfortypemismatch(Name, Object, object(interviews),
'InterViews trigger object lacks proper type'),
checkfortypemismatch(Name, Inmessage, event(interviews),
'InterViews trigger inmessage lacks proper type'),
checkfortypemismatch(Name, Outmessageset, event(interviews),
'InterViews trigger outmessageset includes entity lacking proper type'),
checkfortypemismatch(Name, Outcalls, controlcomponent(interviews),
'InterViews trigger outcalls includes entity lacking proper type'),
checkfortypemismatch(Name, Outspawns, controlcomponent(interviews),
'InterViews trigger outspawns includes entity lacking proper type').
validentity(system(interviews), Name) :-
indatabase([Name]),
validentity(system(base), Name),
getvalues(system, _, Name,
[controlcomponents, globalobjects, recognizedmessages, triggers],
[Controlcomponents, Globalobjects, Recognizedmessages, Triggers]),
checkfortypemismatch(Name, Controlcomponents, controlcomponent(interviews),
'InterViews system controlcomponents includes entity lacking proper type'),
checkfortypemismatch(Name, Globalobjects, object(interviews),
'InterViews system globalobjects includes entity lacking proper type'),
/* checkfortypemismatch(Name, Recognizedmessages, event(interviews),
'InterViews system recognizedmessages includes entity lacking proper type'),*/
checkfortypemismatch(Name, Triggers, trigger(interviews),
'InterViews system triggers includes entity lacking proper type'),
((Triggers == [unspecified] ; Triggers == []) ->
zz('InterViews system needs a set of triggers', Name, Triggers);
true
).
/*************************************************************************/
/*typeschema(entity(style), variable attributes, types of former,
fixed attributes, fixed attributes values, parent entity(style))*/
typeschema(event(interviews),
[],
[],
[type],
[[string]],
datacomponent(base)).
typeschema(controlcomponent(interviews),
[],
[],
[],
[],
controlcomponent(base)).
typeschema(object(interviews),
[],
[],
[],
[],
object(base)).
typeschema(trigger(interviews),
[],
[],
[subtype],
[[ctype]],
trigger(base)).
typeschema(system(interviews),
[],
[],
[recognizedmessages],
[[xevent_keypress, xevent_keyrelease, xevent_buttonpress]],
system(base)).
informalnames(system(interviews),
['Initial Control Components',
'Initial Data Connectors ',
'Global Objects ',
'Control Components ',
'Classes ',
'Shared Data ',
'Data Connectors ',
'Calls ',
'Spawns ',
'Recognized Messages ',
'Triggers ',
'Call Layers ',
'Spawn Layers ',
'Data Connector Layers ',
'Nodes ',
'Resources ',
'Platform ']).