-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.inf
More file actions
86 lines (65 loc) · 8.34 KB
/
test.inf
File metadata and controls
86 lines (65 loc) · 8.34 KB
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
╔══════════════════════════════════════════════════════════════════════════════╗
║ HUMAN-READABLE INFERENCE FILE - INFIX NOTATION ║
╚══════════════════════════════════════════════════════════════════════════════╝
File Description:
This file uses human-readable INFIX notation for expressing relationships.
Unlike Prolog's prefix notation, this is more natural to read and write.
Primary Syntax:
# (Subject)Relation(Object) ← INFIX (Natural, Human-Readable)
# NOT: Relation(Subject, Object) ← PREFIX (Prolog style, less readable)
Examples:
# (Pedro)EsAmigoDe(Miguel) - Pedro is friend of Miguel
# (Pedro)es_amigo_de(Miguel) - Same with snake_case
# (Bob)PadreDe(Pedro) - Bob is father of Pedro
# (Pedro)patea(Ball)impacta(Wall) - Chained: Pedro kicks Ball, impacts Wall
Automatic Formatting:
- CamelCase: "EsAmigoDe" → "es amigo de"
- snake_case: "es_amigo_de" → "es amigo de"
- Any relation name works!
# ═════════════════════════════════════════════════════════════════════════════
# ENTITY DEFINITIONS - Using Infix Notation
# ═════════════════════════════════════════════════════════════════════════════
# Define what each entity is using (Entity)Es(Type) or (Entity)EsUn(Type)
# Multiple relations with same subject will be concatenated with "y"
(Pedro)EsUn(estudiante) # Pedro is a student
(Pedro)Estudia(Informatica) # Pedro studies Computer Science
(Pedro)ViveEn(Madrid) # Pedro lives in Madrid
(Bob)EsUn(programador) # Bob is a programmer
(Bob)TrabajaEn(Microsoft) # Bob works at Microsoft
(Bob)ViveEn(Seattle) # Bob lives in Seattle
(Marco)EsUn(programador) # Marco is a programmer
(Marco)TrabajaEn(OpenAI) # Marco works at OpenAI
(Ball)Es(pelota) # Ball is ball
(Ball)Tiene(color, rojo) # Ball has color, red
(Wall)Es(pared) # Wall is wall
(Wall)Tiene(altura, 2metros) # Wall has height, 2 meters
(Miguel)IsAs(Student) # Miguel is a student
(Miguel)Study(Matematicas) # Miguel studies Mathematics
(Miguel)live_in(Barcelona) # Miguel lives in Barcelona
# ═════════════════════════════════════════════════════════════════════════════
# FAMILY RELATIONSHIPS - Demonstrating Concatenation
# ═════════════════════════════════════════════════════════════════════════════
# Express family relationships - these will be concatenated automatically
(Bob)PadreDe(Pedro) # Bob is father of Pedro
(Bob)ColegaDe(Marco) # Bob is colleague of Marco
(Pedro)HijoDe(Bob) # Pedro is son of Bob
(Pedro)EsAmigoDe(Miguel) # Pedro is friend of Miguel
# ═════════════════════════════════════════════════════════════════════════════
# CHAINED ACTIONS - Showing Causality
# ═════════════════════════════════════════════════════════════════════════════
# Chain multiple relations to show sequences of events
(Pedro)patea(Ball)impacta(Wall) # Pedro kicks Ball, Ball impacts Wall
(Ball)rebota_en(Wall)cae_al(suelo) # Ball bounces on Wall, Ball falls to floor
# ═════════════════════════════════════════════════════════════════════════════
# MIXED FORMATS & MULTI-PROPERTY DEMONSTRATION
# ═════════════════════════════════════════════════════════════════════════════
# Multiple properties for the same subject will be concatenated
(Marco)Escribe(codigo) # Marco writes code
(Marco)Enseña(Python, Pedro) # Marco teaches Python to Pedro
(Marco)PareceUn(genio) # Marco seems like genius
(Ball)EstaEn(aire) # Ball is in air
(Ball)EstaEnMovimiento() # Ball is in movement
(Ball)Tiene(tamaño, grande) # Ball has size, large
(Wall)esta_cerca_de(puerta) # Wall is close to door
(Wall)Tiene(material, ladrillo) # Wall has material, brick
(Wall)EstaEstable() # Wall is stable