index.html
317 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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>RIF Framework for Logic Dialects</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<style type="text/css">
.editsection { display: none; }
</style>
<link href="tr.css" rel="stylesheet" type="text/css" />
<link href="http://www.w3.org/StyleSheets/TR/W3C-REC" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="head">
<a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72" /></a><h1 id="title" style="clear:both"><span id="short-title">RIF Framework for Logic Dialects</span></h1>
<h2 id="W3C-doctype">W3C Recommendation 22 June 2010</h2>
<!-- no inplace warning -->
<dl>
<dt>This version:</dt>
<dd><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/" id="this-version-url">http://www.w3.org/TR/2010/REC-rif-fld-20100622/</a></dd>
<dt>Latest version:</dt>
<dd><a href="http://www.w3.org/TR/rif-fld/">http://www.w3.org/TR/rif-fld/</a></dd>
<dt>Previous version:</dt>
<dd><a href="http://www.w3.org/TR/2010/PR-rif-fld-20100511/">http://www.w3.org/TR/2010/PR-rif-fld-20100511/</a> (<a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/diff-from-20100511">color-coded diff</a>)</dd>
</dl>
<dl><dt>Editors:</dt><dd>Harold Boley, National Research Council Canada</dd>
<dd>Michael Kifer, State University of New York at Stony Brook, USA</dd>
</dl>
<p>Please refer to the <a href="http://www.w3.org/2010/rif/errata"><strong>errata</strong></a> for this document, which may include some normative corrections.</p>
<p>This document is also available in these non-normative formats: <a href="http://www.w3.org/2010/pdf/REC-rif-fld-20100622.pdf">PDF version</a>.</p>
<p>See also <a href="http://www.w3.org/2010/rif/translation/rif-fld">translations</a>.</p>
<p class="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2010 <a href="http://www.w3.org/"><acronym title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a href="http://www.csail.mit.edu/"><acronym title="Massachusetts Institute of Technology">MIT</acronym></a>, <a href="http://www.ercim.eu/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a> and <a href="http://www.w3.org/Consortium/Legal/copyright-documents">document use</a> rules apply.</p>
</div>
<hr />
<h2><a id="abstract" name="abstract">Abstract</a></h2>
<div>
<div><p></p> <p></p> <p></p> <p>This document, developed by the <a href="http://www.w3.org/2005/rules/wiki/RIF_Working_Group" title="RIF Working Group">Rule Interchange Format (RIF) Working Group</a>, defines a general RIF Framework for Logic Dialects (RIF-FLD). The framework describes mechanisms for specifying the syntax and semantics of logic RIF dialects through a number of generic concepts such as signatures, symbol spaces, semantic structures, and so on. The actual dialects should specialize this framework to produce their syntaxes and semantics. </p> <p></p></div>
</div>
<h2 class="no-toc no-num">
<a id="w3c_status" name="w3c_status">Status of this Document</a>
</h2>
<h4 class="no-toc no-num" id="may-be">May Be Superseded</h4>
<p><em>This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the <a href="http://www.w3.org/TR/">W3C technical reports index</a> at http://www.w3.org/TR/.</em></p>
<h4 class="no-toc no-num" id="related">Set of Documents</h4>
<p>This document is being published as one of a set of 11 documents: </p>
<ol>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-overview-20100622/">RIF Overview</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">RIF Core Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">RIF Basic Logic Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">RIF Production Rule Dialect</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-fld-20100622/">RIF Framework for Logic Dialects</a> (this document)</li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/">RIF Datatypes and Built-Ins 1.0</a></li>
<li><a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/">RIF RDF and OWL Compatibility</a></li>
<li><a href="http://www.w3.org/TR/2010/NOTE-rif-owl-rl-20100622/">OWL 2 RL in RIF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-xml-data-20100622/">RIF Combination with XML data</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-in-rdf-20100622/">RIF In RDF</a></li>
<li><a href="http://www.w3.org/TR/2010/WD-rif-test-20100622/">RIF Test Cases</a></li>
</ol>
<!-- no eventStatusExtra -->
<!-- no statusExtra -->
<div>
<h4 class="no-toc no-num" id="sotd-xml-dep">XML Schema Datatypes Dependency</h4>
<p>RIF is defined to use datatypes defined in the <a href="http://www.w3.org/TR/xmlschema-2/">XML Schema Definition Language (XSD)</a>. As of this writing, the latest W3C Recommendation for XSD is version 1.0, with <a href="http://www.w3.org/TR/xmlschema11-1/">version 1.1</a> progressing toward Recommendation. RIF has been designed to take advantage of the new datatypes and clearer explanations available in XSD 1.1, but for now those advantages are being partially put on hold. Specifically, until XSD 1.1 becomes a W3C Recommendation, the elements of RIF which are based on it should be considered <em>optional</em>, as detailed in <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#XML_Schema_Datatypes">Datatypes and Builtins, section 2.3</a>. Upon the publication of XSD 1.1 as a W3C Recommendation, those elements will cease to be optional and are to be considered required as otherwise specified.</p>
<p>We suggest that for now developers and users follow the <a href="http://www.w3.org/TR/2009/WD-xmlschema11-1-20091203/">XSD 1.1 Last Call Working Draft</a>. Based on discussions between the Schema, RIF and OWL Working Groups, we do not expect any implementation changes will be necessary as XSD 1.1 advances to Recommendation.</p>
</div>
<h4 class="no-toc no-num" id="status-changes">Document Unchanged</h4>
<p>There have been no changes to the body of this document since the <a href="http://www.w3.org/TR/2010/PR-rif-fld-20100511/">previous version</a>. For details on earlier changes, see the <a href="#changelog">change log</a>.</p>
<h4 class="no-toc no-num" id="please">Please Send Comments</h4><p>Please send any comments to <a class="mailto" href="mailto:public-rif-comments@w3.org">public-rif-comments@w3.org</a>
(<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-comments/">public
archive</a>). Although work on this document by the <a href="http://www.w3.org/2005/rules/wg.html">Rule Interchange Format (RIF) Working Group</a> is complete, comments may be addressed in the <a href="http://www.w3.org/2010/rif/errata">errata</a> or in future revisions. Open discussion among developers is welcome at <a class="mailto" href="mailto:public-rif-dev@w3.org">public-rif-dev@w3.org</a> (<a class="http" href="http://lists.w3.org/Archives/Public/public-rif-dev/">public archive</a>).</p>
<h4 class="no-toc no-num" id="endorsement">Endorsed By W3C</h4>
<p><em>This document has been reviewed by W3C Members, by software developers, and by other W3C groups and interested parties, and is endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web.</em></p>
<h4 class="no-toc no-num" id="patents">Patents</h4>
<p><em>This document was produced by a group operating under the <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a <a href="http://www.w3.org/2004/01/pp-impl/38457/status" rel="disclosure">public list of any patent disclosures</a> made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent.</em></p>
<hr title="Separator After Status Section" />
<p><span class="anchor" id="sec-overview"></span>
</p>
<table class="toc" id="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Table of Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="#Overview_of_RIF-FLD"><span class="tocnumber">1</span> <span class="toctext">Overview of RIF-FLD</span></a></li>
<li class="toclevel-1"><a href="#Syntactic_Framework"><span class="tocnumber">2</span> <span class="toctext">Syntactic Framework</span></a>
<ul>
<li class="toclevel-2"><a href="#Syntax_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD"><span class="tocnumber">2.1</span> <span class="toctext">Syntax of a RIF Dialect as a Specialization of RIF-FLD</span></a></li>
<li class="toclevel-2"><a href="#Alphabet"><span class="tocnumber">2.2</span> <span class="toctext">Alphabet</span></a></li>
<li class="toclevel-2"><a href="#Symbol_Spaces"><span class="tocnumber">2.3</span> <span class="toctext">Symbol Spaces</span></a></li>
<li class="toclevel-2"><a href="#Terms"><span class="tocnumber">2.4</span> <span class="toctext">Terms</span></a></li>
<li class="toclevel-2"><a href="#Schemas_for_Externally_Defined_Terms"><span class="tocnumber">2.5</span> <span class="toctext">Schemas for Externally Defined Terms</span></a></li>
<li class="toclevel-2"><a href="#Signatures"><span class="tocnumber">2.6</span> <span class="toctext">Signatures</span></a></li>
<li class="toclevel-2"><a href="#Presentation_Syntax_of_a_RIF_Dialect"><span class="tocnumber">2.7</span> <span class="toctext">Presentation Syntax of a RIF Dialect</span></a></li>
<li class="toclevel-2"><a href="#Well-formed_Terms_and_Formulas"><span class="tocnumber">2.8</span> <span class="toctext">Well-formed Terms and Formulas</span></a></li>
<li class="toclevel-2"><a href="#Annotations_in_the_Presentation_Syntax"><span class="tocnumber">2.9</span> <span class="toctext">Annotations in the Presentation Syntax</span></a></li>
<li class="toclevel-2"><a href="#EBNF_Grammar_for_the_Presentation_Syntax_of_RIF-FLD"><span class="tocnumber">2.10</span> <span class="toctext">EBNF Grammar for the Presentation Syntax of RIF-FLD</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Semantic_Framework"><span class="tocnumber">3</span> <span class="toctext">Semantic Framework</span></a>
<ul>
<li class="toclevel-2"><a href="#Semantics_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD"><span class="tocnumber">3.1</span> <span class="toctext">Semantics of a RIF Dialect as a Specialization of RIF-FLD</span></a></li>
<li class="toclevel-2"><a href="#Truth_Values"><span class="tocnumber">3.2</span> <span class="toctext">Truth Values</span></a></li>
<li class="toclevel-2"><a href="#Datatypes"><span class="tocnumber">3.3</span> <span class="toctext">Datatypes</span></a></li>
<li class="toclevel-2"><a href="#Semantic_Structures"><span class="tocnumber">3.4</span> <span class="toctext">Semantic Structures</span></a></li>
<li class="toclevel-2"><a href="#Annotations_and_the_Formal_Semantics"><span class="tocnumber">3.5</span> <span class="toctext">Annotations and the Formal Semantics</span></a></li>
<li class="toclevel-2"><a href="#Interpretation_of_Non-document_Formulas"><span class="tocnumber">3.6</span> <span class="toctext">Interpretation of Non-document Formulas</span></a></li>
<li class="toclevel-2"><a href="#Interpretation_of_Documents"><span class="tocnumber">3.7</span> <span class="toctext">Interpretation of Documents</span></a></li>
<li class="toclevel-2"><a href="#Intended_Semantic_Structures"><span class="tocnumber">3.8</span> <span class="toctext">Intended Semantic Structures</span></a></li>
<li class="toclevel-2"><a href="#Logical_Entailment"><span class="tocnumber">3.9</span> <span class="toctext">Logical Entailment</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#XML_Serialization_Framework"><span class="tocnumber">4</span> <span class="toctext">XML Serialization Framework</span></a>
<ul>
<li class="toclevel-2"><a href="#XML_for_the_RIF-FLD_Language"><span class="tocnumber">4.1</span> <span class="toctext">XML for the RIF-FLD Language</span></a></li>
<li class="toclevel-2"><a href="#Mapping_from_the_RIF-FLD_Presentation_Syntax_to_the_XML_Syntax"><span class="tocnumber">4.2</span> <span class="toctext">Mapping from the RIF-FLD Presentation Syntax to the XML Syntax</span></a>
<ul>
<li class="toclevel-3"><a href="#Mapping_of_the_Non-annotated_RIF-FLD_Language"><span class="tocnumber">4.2.1</span> <span class="toctext">Mapping of the Non-annotated RIF-FLD Language</span></a></li>
<li class="toclevel-3"><a href="#Mapping_of_RIF-FLD_Annotations"><span class="tocnumber">4.2.2</span> <span class="toctext">Mapping of RIF-FLD Annotations</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1"><a href="#Conformance_of_RIF_Processors_with_RIF_Dialects"><span class="tocnumber">5</span> <span class="toctext">Conformance of RIF Processors with RIF Dialects</span></a></li>
<li class="toclevel-1"><a href="#References"><span class="tocnumber">6</span> <span class="toctext">References</span></a>
<ul>
<li class="toclevel-2"><a href="#Normative_References"><span class="tocnumber">6.1</span> <span class="toctext">Normative References</span></a></li>
<li class="toclevel-2"><a href="#Informational_References"><span class="tocnumber">6.2</span> <span class="toctext">Informational References</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Appendix:_XML_Schema_for_RIF-FLD"><span class="tocnumber">7</span> <span class="toctext">Appendix: XML Schema for RIF-FLD</span></a>
<ul>
<li class="toclevel-2"><a href="#Baseline_Schema_Module"><span class="tocnumber">7.1</span> <span class="toctext">Baseline Schema Module</span></a></li>
<li class="toclevel-2"><a href="#Skyline_Schema_Module"><span class="tocnumber">7.2</span> <span class="toctext">Skyline Schema Module</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="#Appendix:_A_Subframework_for_Herbrand_Semantic_Structures"><span class="tocnumber">8</span> <span class="toctext">Appendix: A Subframework for Herbrand Semantic Structures</span></a></li>
<li class="toclevel-1"><a href="#Appendix:_Change_Log_.28Informative.29"><span class="tocnumber">9</span> <span class="toctext">Appendix: Change Log (Informative)</span></a></li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a id="Overview_of_RIF-FLD" name="Overview_of_RIF-FLD"></a><h2> <span class="mw-headline">1 Overview of RIF-FLD </span></h2>
<p>The RIF Framework for Logic Dialects (RIF-FLD) is a formalism for specifying all logic dialects of RIF, including the RIF Basic Logic Dialect [<a href="#ref-rif-bld" title="">RIF-BLD</a>] and [<a href="#ref-rif-core" title="">RIF-Core</a>] (albeit not [<a href="#ref-rif-prd" title="">RIF-PRD</a>], as the latter is not a logic-based RIF dialect). RIF-FLD is a formalism in which both syntax and semantics are described through a number of mechanisms that are commonly used for various logic languages, but are rarely brought all together. Amalgamation of several different mechanisms is required because the framework must be broad enough to accommodate several different types of logic languages and because various advanced mechanisms are needed to facilitate translation into a common framework. RIF-FLD gives precise definitions to these mechanisms, but allows well-defined aspects to vary. The design of RIF envisions that future standard logic dialects will be based on RIF-FLD. Therefore, for any RIF dialect to become a standard, its development should start as a specialization of FLD and extensions to (or, deviations from) FLD should be justified.
</p><p>The framework described in this document is very general and captures most of the popular logic rule languages found in Databases, Logic Programming, and on the Semantic Web. However, it is anticipated that the needs of future dialects might stimulate further evolution of RIF-FLD. In particular, future extensions might include a logic rendering of actions as found in production and reactive rule languages.
This would support Semantic Web services languages such as [<a href="#ref-swsl-rules" title="">SWSL-Rules</a>] and [<a href="#ref-wsml-rules" title="">WSML-Rules</a>].
</p><p>This document is mostly intended for the <i>designers</i> of future RIF dialects. All logic RIF dialects should be <i>derived</i> from RIF-FLD <i>by specialization</i>, as explained in Sections <a href="#sec-dialect-syntax" title="">Syntax of a RIF Dialect as a Specialization of RIF-FLD</a> and <a href="#sec-rif-dialect-semantics" title="">Semantics of a RIF Dialect as a Specialization of RIF-FLD</a>. In addition to specialization, to lower the barrier of entry for their intended audiences, a dialect designer may choose to also specify the syntax and semantics in a direct, but equivalent, way, which does not require familiarity with RIF-FLD. For instance, the RIF Basic Logic Dialect [<a href="#ref-rif-bld" title="">RIF-BLD</a>] is specified by specialization from RIF-FLD and also directly, without relying on the framework. Thus, the reader who is only interested in RIF-BLD can proceed directly to that document.
</p><p>RIF-FLD has the following main components:
</p>
<ul><li> <i>Syntactic framework.</i> This framework defines the mechanisms for specifying the formal <b>presentation syntax</b> of RIF logic dialects by specializing the presentation syntax of the framework. The presentation syntax is used in RIF to define the semantics of the dialects and to illustrate the main ideas with examples. This syntax is not intended to be a concrete syntax for the dialects; it leaves out details such as the delimiters of the various syntactic components, parenthesizing, precedence of operators, and the like. Since RIF is an interchange format, it uses <b>XML as its only concrete syntax</b>.
</li><li> <i>Semantic framework.</i> The semantic framework describes the mechanisms that are used for specifying the models of RIF logic dialects.
</li><li> <i>XML serialization framework.</i> This framework defines the general principles that logic dialects are to use in specifying their concrete XML-based syntaxes. For each dialect, its concrete XML syntax is a derivative of the dialect's presentation syntax. It can be seen as a serialization of that syntax.
</li></ul>
<p><b>Syntactic framework.</b> The syntactic framework defines eleven types of RIF terms:
</p>
<ul>
<li> <i>Constants and variables</i>. These terms are common to most logic languages.
</li>
<li> <i>Positional terms.</i> These terms are commonly used in first-order logic. RIF-FLD defines positional terms in a slightly more general way in order to enable dialects with higher-order syntax, such as HiLog [<a href="#ref-hilog-93" title="">CKW93</a>] and Relfun [<a href="#ref-relfun-99" title="">RF99</a>].
</li>
<li> <i>Terms with named arguments</i>. These are like positional terms except that each argument of a term is named and the order of the arguments is immaterial. Terms with named arguments generalize the notion of rows in relational tables, where column headings correspond to argument names.
</li>
<li>
<i>Lists</i>. These terms correspond to lists in logic programming, and are used in the <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/" title="BLD">Basic Logic Dialect</a>. Restricted versions of these terms are used in the <a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/" title="Core">Core Dialect</a> and the <a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/" title="PRD">Production Rules Dialect</a>.
</li>
<li> <i>Frames</i>. A frame term represents an assertion about an object and its properties. These terms correspond to molecules of F-logic [<a href="#ref-flogic-95" title="">KLW95</a>]. There is syntactic similarity between terms with named arguments and frames, since properties (or attributes) of an object resemble named arguments. However, the semantics of these terms are different (see Section <a href="#sec-model-theory" title="">Semantic Structures</a>).
</li>
<li> <i>Classification</i>. These terms are used to define the subclass and class membership relationships. There are two kinds of classification terms: <em>membership terms</em> and <em>subclass terms</em>. Like frames, these terms were borrowed from F-logic [<a href="#ref-flogic-95" title="">KLW95</a>].
</li>
<li> <i>Equality</i>. These terms are used to equate other terms.
<p>
It should be noted that [<a href="#ref-rif-dtb" title="">RIF-DTB</a>] introduces a number of built-in equality predicates for the various data types (for instance, <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#pred-numeric-equal" title="DTB"><tt>pred:numeric-equal</tt></a> or <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#pred-boolean-equal" title="DTB"><tt>pred:boolean-equal</tt></a>). Those predicates have fixed interpretations, which coincide with the interpretation of the equality terms defined in this document when the latter are evaluated over data types. However, outside of the data types, the interpretation of the equality terms may vary and is determined by the contents of RIF documents.
General use of equality terms is supported in systems such as FLORA-2 [<a href="#ref-flora2" title="">FL2</a>], and special cases are also allowed in Relfun [<a href="#ref-relfun-99" title="">RF99</a>].
</p>
</li>
<li>
<i>Formula terms</i>. These terms are the ones for which truth values are defined by the RIF semantic framework. Most dialects would treat such terms in a special way and will impose various restrictions on the contexts in which such terms will be allowed to occur. Some advanced dialects, however, will have fewer such restrictions, which will make it possible to <i>reify</i> formulas and manipulate them as objects.
</li>
<li>
<i>External</i>. These terms are used to represent built-ins and external data sources that are treated as "black boxes."
</li>
<li>
<i>Aggregation</i>. These are the terms that are used to represent aggregation functions over sets.
</li>
<li>
<i>Remote</i>. These terms are used to represent queries to RIF documents that are not part of the RIF document that contains these terms.
</li>
</ul>
<p>
Terms are then used to define several types of RIF-FLD <i>formulas</i>. RIF dialects can choose to permit all or some of the aforesaid categories of terms.
In addition, RIF-FLD introduces <i>extension points</i>, one of which allows the introduction of new kinds of terms. An
<span class="anchor" id="ref-extension-point">
<i><b>extension point</b></i>
</span>
is a keyword that is not a syntactic construct per se, but a placeholder that is supposed to be replaced by specific syntactic constructs of an appropriate kind. RIF-FLD defines several types of extension points: symbols (<a href="#ref-newsymbol" title=""><tt>NEWSYMBOL</tt></a>), connectives (<a href="#ref-newconective" title=""><tt>NEWCONNECTIVE</tt></a>), quantifiers (<a href="#ref-newquantifier" title=""><tt>NEWQUANTIFIER</tt></a>), aggregate functions (<a href="#ref-newaggrfunc" title=""><tt>NEWAGGRFUNC</tt></a>), and terms (<a href="#ref-newterm" title=""><tt>NEWTERM</tt></a>).
</p>
<p>
The syntactic framework also defines the following specialization mechanisms:
</p>
<ul>
<li> <i>Symbol spaces.</i>
<p>
Symbol spaces partition the set of non-logical symbols that correspond to individual constants, predicates, and functions, and each partition is then given its own semantics. A symbol space has an identifier and a <i>lexical space</i>, which defines the "shape" of the symbols in that symbol space. Some symbol spaces in RIF are used to identify Web entities and their lexical space consists of strings that syntactically look like <i>internationalized resource identifiers</i> [<a href="#ref-rfc-3987" title="">RFC-3987</a>], or IRIs (e.g., <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-iri-space" title="DTB">http://www.w3.org/2007/rif#iri</a>). Other symbol spaces are used to represent the datatypes required by RIF (for example, <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#xs-integer-space" title="DTB">http://www.w3.org/2001/XMLSchema#integer</a>).
</p>
</li>
<li> <i>Signatures.</i>
<p>
Signatures determine which terms and formulas are <i>well-formed</i>. They constitute a generalization of the notion of <i>sorts</i> in classical first-order logic [<a href="#ref-enderton01" title="">Enderton01</a>]. Each nonlogical symbol (and some logical symbols, like <tt>=</tt>) has an associated signature. A signature defines, in a precise way, the syntactic contexts in which the symbol is allowed to occur.
</p>
<p>
For instance, the signature associated with a symbol <tt>p</tt> might allow <tt>p</tt> to appear in a term of the form <tt>f(p)</tt>, but disallow it to occur in a term like <tt>p(a,b)</tt>. The signature for <tt>f</tt>, on the other hand, might allow that symbol to appear in <tt>f(p)</tt> and <tt>f(p,q)</tt>, but disallow <tt>f(p,q,r)</tt> and <tt>f(f)</tt>. In this way, it is possible to control which symbols are used for predicates and which for functions, where variables can occur, and so on.
</p>
<p>
Depending on their needs, dialects can decide which symbols have which signatures.
</p>
</li>
<li> <i>Restriction.</i>
<p>
A dialect might impose further restrictions on the form of a particular kind of term or formula. For example, variables or aggregate terms might not be allowed in certain places.
</p>
</li>
<li>
<i>Extension points.</i>
RIF dialects are required to replace <a href="#ref-extension-point" title="">extension points</a> with zero or more specific syntactic constructs of an appropriate kind. Note that in this way extension becomes part of specialization.
</li>
</ul>
<p><b>Semantic framework.</b> This framework defines the notion of a <i>semantic structure</i> (also known as <i>interpretation</i> in the literature [<a href="#ref-enderton01" title="">Enderton01</a>, <a href="#ref-mendelson97" title="">Mendelson97</a>]). Semantic structures are used to interpret formulas and to define <i>logical entailment</i>. As with the syntax, this framework includes a number of mechanisms that RIF logic dialects can specialize to suit their needs. These mechanisms include:
</p>
<ul>
<li> <i>Set of truth values.</i> RIF-FLD is designed to accommodate dialects that support reasoning with inconsistent and uncertain information. Most of the logics that are designed to deal with these situations are multi-valued. Consequently, RIF-FLD postulates that there is a set of truth values, <i><b>TV</b></i>, which includes the values <i><b>t</b></i> (true) and <i><b>f</b></i> (false) and possibly others. For example, the RIF Basic Logic Dialect [<a href="#ref-rif-bld" title="">RIF-BLD</a>] is two-valued, but other dialects can have additional truth values.
</li>
<li>
<i>Semantic structures</i>. Semantic structures determine how the different symbols in the alphabet of a dialect are interpreted and how truth values are assigned to formulas.
</li>
<li> <i>Datatypes.</i> Some symbol spaces that are part of the RIF syntactic framework have fixed interpretations. For instance, symbols in the symbol space <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#xs-string-space" title="DTB">http://www.w3.org/2001/XMLSchema#string</a> are always interpreted as sequences of Unicode characters, and <tt>a</tt> ≠ <tt>b</tt> for any pair of distinct symbols. A symbol space whose symbols have a fixed interpretation in any semantic structure is called a <a href="#def-fld-datatype" title="">datatype</a>.
</li>
<li> <i>Entailment.</i> This notion is fundamental to logic-based dialects. Given a set of formulas (e.g., facts and rules) <tt>G</tt>, entailment determines which other formulas necessarily follow from <tt>G</tt>. Entailment is the main mechanism underlying query answering in Databases, Logic Programming, and the various reasoning tasks in Description Logics.
<p>
A set of formulas <tt>G</tt> logically entails another formula <tt>g</tt> if for every semantic structure <i><b>I</b></i> in some set <b>S</b>, if <tt>G</tt> is true in <i><b>I</b></i> then <tt>g</tt> is also true in <i><b>I</b></i>. Almost all logics define entailment this way. The difference lies in which set <b>S</b> they use. For instance, logics that are based on the classical first-order predicate calculus, such as most Description Logics, assume that <b>S</b> is the set of <i>all</i> semantic structures. In contrast, most Logic Programming languages use <i>default negation</i>. Accordingly, the set <b>S</b> contains only the so-called minimal Herbrand models [<a href="#ref-lloyd-87" title="">Lloyd87</a>] of <tt>G</tt> and, furthermore, only the minimal models of a special kind. See [<a href="#ref-shoham-87" title="">Shoham87</a>] for a more detailed exposition of this subject.
</p>
</li>
</ul>
<p><b>XML serialization framework.</b> This framework defines the general principles for mapping the presentation syntax of RIF-FLD to the concrete XML interchange format. This includes:
</p>
<ul><li> A specification of the XML syntax for RIF-FLD, including the associated XML Schema document.
</li><li> A specification of a one-to-one mapping from the presentation syntax of RIF-FLD to its XML syntax. This mapping must map any well-formed formula of RIF-FLD to an XML instance document that is valid with respect to the aforesaid XML Schema document.
</li></ul>
<p>This specification is the latest draft of the RIF-FLD definition. Each RIF
dialect that is derived from RIF-FLD will be described in its own document.
The first such dialect, the RIF Basic Logic Dialect, is described in
[<a href="#ref-rif-bld" title="">RIF-BLD</a>]. A core dialect, which is defined by further specializing RIF-BLD, is specified in [<a href="#ref-rif-core" title="">RIF-Core</a>].
</p><p><span id="sec-syntactic-framework"></span>
</p>
<a id="Syntactic_Framework" name="Syntactic_Framework"></a><h2> <span class="mw-headline">2 Syntactic Framework </span></h2>
<p>The next subsection explains how to derive the presentation syntax of a RIF dialect from the presentation syntax of the RIF framework. The actual syntax of the RIF framework is given in subsequent subsections.
</p><p>In the (normative) subsections 2 to 9, the presentation syntax is
defined using "mathematical English," a special form of English for communicating mathematical definitions, examples, etc.
In the non-normative final subsection <a href="#sec-concrete-syntax" title="">EBNF Grammar for the Presentation Syntax of RIF-FLD</a>, a grammar for a superset of the presentation syntax is given using Extended Backus–Naur Form (EBNF).
</p><p><br />
<span class="anchor" id="sec-dialect-syntax"></span>
</p>
<a id="Syntax_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD" name="Syntax_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD"></a><h4> <span class="mw-headline">2.1 Syntax of a RIF Dialect as a Specialization of RIF-FLD </span></h4>
<p>The <i><b>presentation syntax for a RIF dialect</b></i> can be obtained from the general syntactic framework of RIF by specializing the following parameters, which are defined later in this document:
</p>
<ol>
<li>The alphabet of RIF-FLD can be restricted by omitting symbols; it can also be expanded by <i>actualizing</i> the extension points <tt>NEWSYMBOL</tt>, <tt>NEWCONNECTIVE</tt>, <tt>NEWQUANTIFIER</tt>, and <tt>NEWAGGRFUNC</tt>, i.e., by replacing them with zero or more actual symbols of the appropriate kind.</li>
<li>An <i>assignment of signatures</i> to each constant and variable
symbol.
<p>
Signatures determine which terms in the dialect are well-formed and which are not.
</p>
<p>
The exact way signatures are assigned depends on the dialect. An assignment can be explicit or implicit (for instance, derived from the context in which each symbol is used).
</p>
</li>
<li>The <i>choice of the types of terms</i> supported by the dialect.
<p>
The RIF logic framework introduces the following types of terms:
</p>
<ul>
<li>constant </li>
<li>variable </li>
<li>positional </li>
<li>with named arguments </li>
<li>lists </li>
<li>equality </li>
<li>frame </li>
<li>class membership </li>
<li>subclass</li>
<li>aggregates</li>
<li>remote term reference</li>
<li>external</li>
<li>formulas</li>
</ul>
<p>
A dialect might support all of these terms or just a subset. For instance, some dialects might not support terms with named arguments or frame terms or certain forms of external terms (e.g., external frames).
A dialect might even support <em>additional</em> kinds of terms that are not listed above (for instance, typing terms of F-logic [<a href="#ref-flogic-95" title="">KLW95</a>]). This is done by actualizing the extension point <a href="#ref-newterm" title=""><tt>NEWTERM</tt></a>, i.e., by replacing it with zero or more new kinds of terms.
</p>
</li>
<li>The <i>choice of symbol spaces</i> supported by the dialect.
<p>
Symbol spaces determine the syntax of the constant symbols that are allowed in the dialect. All RIF dialects are expected to support certain symbols spaces (see the section <a href="#sec-symbol-spaces" title="">Symbol Spaces</a>). Dialects can also introduce additional symbol spaces, such as a symbol space to represent Skolem constants and functions.
</p>
</li>
<li>The <i>choice of the formulas</i> supported by the dialect.
<p>RIF-FLD offers the following kinds of formula terms "out of the box": </p>
<ul>
<li>Atomic </li>
<li>Conjunction </li>
<li>Disjunction </li>
<li>Symmetric negation (classical, explicit, or strong)</li>
<li>Default negation (as in logic programming)</li>
<li>Rule (as in logic programming as opposed to the classical material implication)
</li>
<li>Quantification (universal and existential)
</li>
<li>
Remote (for querying remote RIF documents)
</li>
<li>
External (built-in predicates and external black-box sources of information)
</li>
</ul>
<p>
A dialect might support all of these formulas or it might impose various restrictions. For instance, the formulas allowed in the conclusion and/or premises of implications might be restricted (e.g., [<a href="#ref-rif-bld" title="">RIF-BLD</a>] essentially allows Horn rules only), certain types of quantification might be prohibited (e.g., [<a href="#ref-rif-bld" title="">RIF-BLD</a>] disallows existential quantification in the rule head), symmetric or default negation (or both) might not be allowed (as in RIF-BLD), etc. The Core subdialect of RIF-BLD disallows equality formulas in the conclusions of rules.
</p>
<p>
More interestingly, dialects can introduce <i>additional</i> types of formulas by adding new connectives (e.g., classical implication or bi-implication) and quantifiers through actualizing the extension points <a href="#ref-newconective" title=""><tt>NEWCONNECTIVE</tt></a> and <a href="#ref-newquantifier" title=""><tt>NEWQUANTIFIER</tt></a>.
</p>
</li>
</ol>
<p>Note that although the presentation syntax of a RIF logic dialect is normative, since semantics is defined in terms of that syntax, the presentation syntax is not intended as a concrete syntax, and <a href="#sec-conformance" title="">conformant systems</a> are not required to implement it.
</p><p><br />
<span class="anchor" id="sec-alphabet"></span>
</p>
<a id="Alphabet" name="Alphabet"></a><h4> <span class="mw-headline">2.2 Alphabet </span></h4>
<p><span class="anchor" id="def-fld-alphabet"></span>
<b>Definition (Alphabet).</b>
The <i><b>alphabet</b></i> of the presentation syntax of RIF-FLD consists of
the following <i>disjoint</i> subsets of symbols:
</p>
<ul>
<li>
A countably infinite set of <i><b>constant symbols</b></i> <tt>Const</tt>.
<p>
Constants are written as <tt>"literal"^^symspace</tt>, where <tt>literal</tt> is a sequence of Unicode characters and <tt>symspace</tt> is an identifier for a symbol space.
This syntax is explained in Section <a href="#sec-symbol-spaces" title="">Symbol Spaces</a>.
</p>
</li>
<li>
A countably infinite set of <i><b>variable symbols</b></i> <tt>Var</tt>.
<p>
Variables are written as Unicode strings preceded by the symbol <tt>?</tt> (e.g., <tt>?x</tt>, <tt>?ABC</tt>).
This makes the sets <tt>Var</tt> and <tt>Const</tt> disjoint.
</p>
</li>
<li>
A countably infinite set of <i><b>argument names</b></i> <tt>ArgNames</tt>.
The set <tt>ArgNames</tt> is disjoint from both <tt>Const</tt> and <tt>Var</tt>.
<p>
Argument names in <tt>ArgNames</tt> are written as Unicode strings that do not start with a <tt>?</tt> (e.g., <tt>Name</tt>, <tt>age</tt>). They are used in predicates and functions that have named arguments.
</p>
</li>
<li>
A finite set of <i><b>connective symbols</b></i>, which includes <tt>And</tt>, <tt>Or</tt>, <tt>Naf</tt>, <tt>Neg</tt>, <tt>:-</tt>, and <tt>NEWCONNECTIVE</tt>.
<p>
<span class="anchor" id="ref-newconective">
<tt>NEWCONNECTIVE</tt>
</span>
is not an actual symbol in the alphabet, but rather a RIF-FLD <a href="#ref-extension-point" title="">extension point</a>, which must be actualized. Dialects are expected to specialize the set of connectives by
</p>
<ul>
<li>
Replacing <tt>NEWCONNECTIVE</tt> with zero or more new connective symbols. Dialects cannot keep the extension point.
</li>
<li>
Dropping zero or more of the predefined connective symbols listed above. Dialects cannot redefine the semantics of the predefined connectives, however.
</li>
</ul>
</li>
<li>
A countably infinite set of <i><b>quantifiers</b></i>, which consists of the symbols <tt>Exists<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> and <tt>Forall<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt>, where <tt>?X<sub>1</sub>, ..., ?X<sub>n</sub></tt>, <tt>n ≥ 1</tt>, are distinct variable symbols; plus the <a href="#ref-extension-point" title="">extension point</a>,
<span class="anchor" id="ref-newquantifier">
<tt>NEWQUANTIFIER</tt>, which must be actualized.
</span>
Dialects are supposed to specialize this repertoire of quantifier symbols by
<ul>
<li>
Replacing <tt>NEWQUANTIFIER</tt> with zero or more new quantifier symbols. Dialects cannot keep the extension point.
</li>
<li>
Dropping zero or more of the predefined quantifier symbols listed above. However, dialects cannot redefine the semantics of the predefined quantifiers.
</li>
</ul>
<p>
In the actual presentation syntax, we will be linearizing the predefined quantifier symbols and write them as
<tt>Exists ?X<sub>1</sub>,...,?X<sub>n</sub></tt> and <tt>Forall ?X<sub>1</sub>,...,?X<sub>n</sub></tt> instead of <tt>Exists<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> and <tt>Forall<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt>.
</p>
<p>
Every quantifier symbol has an
<span class="anchor" id="ref-quantified-variables">
<i><b>associated list of variables</b></i>
</span>
that are <i><b>bound</b></i> by that quantifier.
For the standard quantifiers <tt>Exists<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> and <tt>Forall<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt>, the associated list of variables is <tt>?X<sub>1</sub>,...,?X<sub>n</sub></tt>.
</p>
</li>
<li>
The symbols <tt>=</tt>, <tt>#</tt>, <tt>##</tt>, <tt>-></tt>, <tt>External</tt>, <tt>Dialect</tt>, <tt>Base</tt>, <tt>Prefix</tt>, <tt>Import</tt>, and <tt>Module</tt>.
</li>
<li>
The symbols for representing lists: <tt>List</tt> and <tt>OpenList</tt>.
</li>
<li>
The symbols <tt>Group</tt> and <tt>Document</tt>.
</li>
<li>
A countable set of <i><b>aggregate symbols</b></i> of the form <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub></tt>, where <tt>n ≥ 0</tt>, <tt><em>sym</em></tt> is a symbol that denotes an aggregate function, and <tt>?V</tt>, <tt>?X<sub>1</sub>, ..., ?X<sub>n</sub></tt> are variable symbols. The symbol <tt>?V</tt> is called the <i><b>comprehension variable</b></i> of the aggregate symbol and <tt>?X<sub>1</sub>, ..., ?X<sub>n</sub></tt> are <i><b>grouping variables</b></i>.
<p>
RIF-FLD reserves the following symbols for standard aggregate functions: <tt>Min</tt>, <tt>Max</tt>, <tt>Count</tt>, <tt>Avg</tt>, <tt>Sum</tt>, <tt>Prod</tt>, <tt>Set</tt>, and <tt>Bag</tt>. Aggregate functions also have an <a href="#ref-extension-point" title="">extension point</a>,
<span class="anchor" id="ref-newaggrfunc">
<tt>NEWAGGRFUNC</tt>, which must be actualized.
</span>
Dialects can specialize the aforesaid set of aggregate functions by
</p>
<ul>
<li>
Replacing <tt>NEWAGGRFUNC</tt> with zero or more new symbols for aggregate functions. Dialects cannot keep the extension point.
</li>
<li>
Dropping zero or more of the predefined aggregate functions listed above. However, dialects cannot redefine the semantics of the predefined aggregate functions.
</li>
</ul>
</li>
<li>
Auxiliary symbols <tt>(</tt>, <tt>)</tt>, <tt>[</tt>, <tt>]</tt>, <tt>{</tt>, <tt>}</tt>, <tt><</tt>, <tt>></tt>, <tt>|</tt>, <tt>?</tt>, <tt>@</tt>, and <tt>^^</tt>.
</li>
<li>
An <a href="#ref-extension-point" title="">extension point</a>
<span class="anchor" id="ref-newsymbol">
<tt>NEWSYMBOL</tt>.
</span>
<p>
As with other extension points, this is not an actual symbol in the alphabet, but a placeholder that dialects are supposed to replace with zero or more actual new alphabet symbols.
</p>
</li>
</ul>
<p>The symbol <tt>Naf</tt> represents <i>default negation</i>, which is used in rule languages with logic programming and deductive database semantics.
Examples of default negation include Clark's negation-as-failure [<a href="#ref-negation-as-failure" title="">Clark87</a>], the well-founded negation [<a href="#ref-wf-model" title="">GRS91</a>], and stable-model negation [<a href="#ref-stable-model" title="">GL88</a>].
The name of the symbol <tt>Naf</tt> used here comes from negation-as-failure but in RIF-FLD this can refer to any kind of default negation.
</p><p>The symbol <tt>Neg</tt> represents <i>symmetric negation</i> (as opposed to default negation, which is asymmetric because completely different inference rules are used to derive <tt>p</tt> and <tt>Naf p</tt>). Examples of symmetric negation include classical first-order negation, <i>explicit negation</i>, and <i>strong negation</i> [<a href="#ref-strong-explicit-negation" title="">APP96</a>].
</p><p>The symbols <tt>=</tt>, <tt>#</tt>, and <tt>##</tt> are used in formulas that define equality, class membership, and subclass relationships, respectively. The symbol <tt>-></tt> is used in terms that have named arguments and in frame terms. The symbol <tt>External</tt> indicates that an atomic formula or a function term is defined externally (e.g., a built-in), <tt>Dialect</tt> is a directive used to indicate the dialect of a RIF document (for those dialects that require this), the symbols <tt>Base</tt> and <tt>Prefix</tt> enable abridged representations of IRIs, and the symbol <tt>Import</tt> is an import directive. The <tt>Module</tt> directive is used to connect remote terms with the actual remote RIF documents.
</p><p>Finally, the symbol <tt>Document</tt> is used for specifying RIF-FLD documents and the symbol <tt>Group</tt> is used to organize RIF-FLD formulas into collections. ☐
</p><p><br />
</p><p><br />
<span class="anchor" id="sec-symbol-spaces"></span>
</p>
<a id="Symbol_Spaces" name="Symbol_Spaces"></a><h4> <span class="mw-headline">2.3 Symbol Spaces </span></h4>
<p>Throughout this document, we will be using the following abbreviations:
</p>
<ul><li> <tt>xs:</tt> stands for the XML Schema URI <tt>http://www.w3.org/2001/XMLSchema#</tt>
</li><li> <tt>rdf:</tt> stands for <tt>http://www.w3.org/1999/02/22-rdf-syntax-ns#</tt>
</li><li> <tt>pred:</tt> stands for <tt>http://www.w3.org/2007/rif-builtin-predicates#</tt>
</li><li> <tt>rif:</tt> stands for the URI of RIF, <tt>http://www.w3.org/2007/rif#</tt>
</li></ul>
<p>These and other abbreviations will be used as prefixes in the <i>compact URI</i>-like notation [<a href="#ref-curie" title="">CURIE</a>], a notation for succinct representation of IRIs [<a href="#ref-rfc-3987" title="">RFC-3987</a>]. The precise meaning of this notation in RIF is defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>].
</p><p>The set of all constant symbols in a RIF dialect is partitioned into a number of subsets, called <i>symbol spaces</i>, which are used to represent XML Schema datatypes, datatypes defined in other W3C specifications, such as <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-xmlliteral-space" title="DTB">rdf:XMLLiteral</a></tt>, and to distinguish other sets of constants. All constant symbols have a syntax (and sometimes also semantics) imposed by the symbol space to which they belong.
</p><p><span class="anchor" id="def-fld-symspace"></span>
<b>Definition (Symbol space).</b>
A <i><b>symbol space</b></i> is a named subset of the set of all constants, <tt>Const</tt>. The semantic aspects of symbol spaces will be described in Section <a href="#sec-fld-semantic-framework" title="">Semantic Framework</a>. Each symbol in <tt>Const</tt> belongs to exactly one symbol space.
</p><p>Each symbol space has an associated lexical space and a unique identifier.
More precisely,
</p>
<ul><li> The <i><b>lexical space</b></i> of a symbol space is a non-empty set of Unicode character strings.
</li><li> The <i><b>identifier</b></i> of a symbol space is a sequence of Unicode characters that form an absolute IRI [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
</li><li> Different symbol spaces cannot share the same identifier.
</li></ul>
<p>The identifiers for symbol spaces are <b>not</b> themselves constant symbols in RIF. ☐
</p><p>To simplify the language, we will often use symbol space identifiers to refer to the actual symbol spaces (for instance, we may use "symbol space <tt>xs:string</tt>" instead of "symbol space <i>identified by</i> <tt>xs:string</tt>").
</p><p>To refer to a constant in a particular RIF symbol space, we use the following presentation syntax:
</p>
<pre> "literal"^^symspace
</pre>
<p>where <tt>literal</tt> is called the <i><b>lexical part</b></i> of the symbol, and <tt>symspace</tt> is the identifier of the symbol space. Here <tt>literal</tt> is a sequence of Unicode characters that <i>must</i> be an element in the lexical space of the symbol space <tt>symspace</tt>. For instance, <tt>"1.2"^^xs:decimal</tt> and <tt>"1"^^xs:decimal</tt> are syntactically valid constants because 1.2 and 1 are members of the lexical space of the XML Schema datatype <tt>xs:decimal</tt>. On the other hand, <tt>"a+2"^^xs:decimal</tt> is not a syntactically valid symbol, since <tt>a+2</tt> is not part of the lexical space of <tt>xs:decimal</tt>.
</p><p>The set of all symbol spaces that partition <tt>Const</tt> is considered to
be part of the logic language of RIF-FLD.
</p><p>RIF requires that all dialects include the symbol spaces listed and described in Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-symbol-spaces" title="DTB">Constants and Symbol Spaces</a> of [<a href="#ref-rif-dtb" title="">RIF-DTB</a>] as part of their language. These symbol spaces include constants that belong to several important XML Schema datatypes, certain RDF datatypes, and constant symbols specific to RIF. The latter include the symbol spaces <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-iri-space" title="DTB">rif:iri</a></tt> and <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-local-space" title="DTB">rif:local</a></tt>, which are used to represent internationalized resource identifiers (IRIs [<a href="#ref-rfc-3987" title="">RFC-3987</a>]) and constant symbols that are not visible outside of the RIF document in which they occur, respectively. Documents that are exchanged through RIF can use additional symbol spaces (for instance, a symbol space to represent Skolem constants and functions).
</p><p>We will often refer to constant symbols that come
from a particular symbol space, <tt>X</tt>, as <tt>X</tt> constants. For
instance, the constants in the symbol space <tt>rif:iri</tt> will be referred to
as <i><b>IRI constants</b></i> or <tt>rif:iri</tt> <i><b>constants</b></i> and the constants
found in the symbol space <tt>rif:local</tt> as <i><b>local constants</b></i>
or <tt>rif:local</tt> <i><b>constants</b></i>.
</p><p><br />
</p><p><span class="anchor" id="sec-terms"></span>
</p>
<a id="Terms" name="Terms"></a><h4> <span class="mw-headline">2.4 Terms </span></h4>
<p>The most basic construct of a logic language is a <i>term</i>. RIF-FLD supports many kinds of terms: constants, variables, the regular <i>positional</i> terms, plus terms with <i>named arguments</i>, equality, <i>classification</i> terms, <i>frames</i>, and more. The word "<i>term</i>" will be used to refer to any kind of term.
</p><p><span class="anchor" id="def-fld-term"></span>
<b>Definition (Term).</b>
A <i><b>term</b></i> can have one of the following forms:
</p>
<ol>
<li><i>Constants and variables</i>. If <tt>t</tt> ∈ <tt>Const</tt> or <tt>t</tt> ∈ <tt>Var</tt> then <tt>t</tt> is a <i><b>simple term</b></i>. </li>
<li><i>Positional terms</i>. If <tt>t</tt> and <tt>t<sub>1</sub></tt>, ..., <tt>t<sub>n</sub></tt> are terms then <tt>t(t<sub>1</sub> ... t<sub>n</sub>)</tt> is a <i><b>positional term</b></i>.
<p>
Positional terms in RIF-FLD generalize the regular notion of a term used in first-order logic. For instance, the above definition allows variables everywhere, as in <tt>?X(?Y ?Z(?V "12"^^xs:integer))</tt>, where <tt>?X</tt>, <tt>?Y</tt>, <tt>?Z</tt>, and <tt>?V</tt> are variables. Even <tt>?X("abc"^^xs:string ?W)(?Y ?Z(?V "33"^^xs:integer))</tt> is a positional term (as in HiLog [<a href="#ref-hilog-93" title="">CKW93</a>]).
</p>
</li>
<li><i>Terms with named arguments</i>. A <i><b>term with named arguments</b></i> is of the form <tt>t(s<sub>1</sub>->v<sub>1</sub> ... s<sub>n</sub>->v<sub>n</sub>)</tt>, where <tt>t</tt>, <tt>v<sub>1</sub></tt>, ..., <tt>v<sub>n</sub></tt> are terms, and <tt>s<sub>1</sub></tt>, ..., <tt>s<sub>n</sub></tt> are (not necessarily distinct) symbols from the set <tt>ArgNames</tt>.
<p>
The term <tt>t</tt> here represents a predicate or a function; <tt>s<sub>1</sub></tt>, ..., <tt>s<sub>n</sub></tt> represent argument names; and <tt>v<sub>1</sub></tt>, ..., <tt>v<sub>n</sub></tt> represent argument values. Terms with named arguments are like regular positional terms except that the arguments are named and their order is immaterial. Note that a term with no arguments, like f(), is, trivially, both a positional term and a term with named arguments.
</p>
<p>
For instance, <tt>"person"^^xs:string("http://example.com/name"^^rif:iri->?Y "http://example.com/address"^^rif:iri->?Z)</tt>, <tt>?X("123"^^xs:integer ?W)(arg->?Y arg2->?Z(?V))</tt>, and <tt>"Closure"^^rif:local("http://example.com/relation"^^rif:iri->"http://example.com/Flight"^^rif:iri)("from"^^rif:local->?X "to"^^rif:local->?Y)</tt> are terms with named arguments. The second of these named-argument terms uses a positional term, <tt>?X("123"^^xs:integer ?W)</tt>, in the role of the function, and the third term's function is itself represented by a named-argument term.
</p>
</li>
<li>
<span class="anchor" id="def-list-term">
<i>List terms</i>.
</span>
There are two kinds of list terms: <em>open</em> and <em>closed</em>.
<ul>
<li>
A <i><b>closed list</b></i> has the form <tt>List(t<sub>1</sub> ... t<sub>m</sub>)</tt>, where <tt>m≥0</tt> and <tt>t<sub>1</sub>, ..., t<sub>m</sub></tt> are terms.
</li>
<li>
An <i><b>open list</b></i> (or a list with a tail) has the form
<tt>OpenList(t<sub>1</sub> ... t<sub>m</sub> t)</tt>, where <tt>m>0</tt> and <tt>t<sub>1</sub></tt>, ..., <tt>t<sub>m</sub></tt>, <tt>t</tt> are terms. Open lists are written in the presentation syntax as follows: <tt>List(t<sub>1</sub> ... t<sub>m</sub> | t)</tt>.
<p>
The last argument, <tt>t</tt>, represents the tail of the list and so it is normally a list as well. However, the syntax does not restrict <tt>t</tt> in any way: it could be an integer, a variable, another list, or, in fact, any term. An example is <tt>List(1 2 | 3)</tt>. This is not an ordinary list, where the last argument, <tt>3</tt>, would represent the tail of a list (and thus would also be a list, which <tt>3</tt> is not). Such general open lists correspond to Lisp's dotted lists [<a href="#ref-steele90" title="">Steele90</a>]. Note that they can be the result of instantiating an open list with a variable in the tail, hence are hard to avoid. For instance, <tt>List(1 2 | 3)</tt> is <tt>List(1 2 | ?X)</tt>, where the variable <tt>?X</tt> is replaced with <tt>3</tt>.
</p>
</li>
</ul>
<p>
A closed list of the form <tt>List()</tt> (i.e., a list in which <tt>m=0</tt>) is called the <i><b>empty list</b></i>.
</p>
<p>
</p>
</li>
<li><i>Equality terms</i>. An <i><b>equality term</b></i> has the form <tt>t = s</tt>, where <tt>t</tt> and <tt>s</tt> are terms. </li>
<li><i>Classification terms</i>. There are two kinds of classification terms: <i>class membership terms</i> (or just <i>membership terms</i>) and <i>subclass terms</i>.
<ul>
<li><tt>t#s</tt> is a <i><b>membership term</b></i> if <tt>t</tt> and <tt>s</tt> are terms. </li>
<li><tt>t##s</tt> is a <i><b>subclass term</b></i> if <tt>t</tt> and <tt>s</tt> are terms. </li>
</ul>
<p>
Classification terms are used to describe class hierarchies.
</p>
</li>
<li><i>Frame terms</i>. <tt>t[p<sub>1</sub>->v<sub>1</sub> ... p<sub>n</sub>->v<sub>n</sub>]</tt> is a <i><b>frame term</b></i> (or simply a <i><b>frame</b></i>) if <tt>t</tt>, <tt>p<sub>1</sub></tt>, ..., <tt>p<sub>n</sub></tt>, <tt>v<sub>1</sub></tt>, ..., <tt>v<sub>n</sub></tt>, <tt>n ≥ 0</tt>, are terms.
<p>
Frame terms are used to describe properties of objects. As in the case of the terms with named arguments, the order of the properties <tt>p<sub>i</sub>->v<sub>i</sub></tt> in a frame is immaterial.
</p>
</li>
<li>
<i>Externally defined terms.</i> If <tt>t</tt> is a constant, positional term, a term with named arguments, an equality, a classification, or a frame term then <tt>External(t loc)</tt> is an <i><b>externally defined term</b></i>.
<p>
Such terms are used for representing built-in functions and predicates as well as "procedurally attached" terms or predicates, which might exist in various rule-based systems, but are not specified by RIF.
The <tt>loc</tt> part in an external term is intended to play the role of a <span class="anchor" id="ref-ext-locator"><i><b>locator</b></i></span> of the source that defines the external term <tt>t</tt>. It must uniquely identify the external source. The exact form of the locator <tt>loc</tt>, the protocol that associates locators with external sources, and the type of the imported documents is left to dialects to specify. However, all dialects must support the form <tt><IRI></tt>, where <tt>IRI</tt> is a sequence of Unicode characters that forms an IRI.
</p>
<p>
This syntax enables very flexible representations for externally defined information sources: not only predicates and functions, but also frames, classification, and equality terms can be used. In this way, external sources can be modeled in an object-oriented way. For instance, <tt>External("http://example.com/acme"^^rif:iri["http://example.com/mycompany/president"^^rif:iri(?Year) -> ?Pres] <http://example.com/acme>)</tt> could be a representation for an external method <tt>"http://example.com/mycompany/president"^^rif:iri</tt> in an external object identified by the IRI <tt>http://example.com/acme</tt>.
</p>
<p>
Since, in most cases, external terms are expected to be based on predicates, RIF-FLD also permits a <span class="anchor" id="ref-external-shorthand"> shorthand notation:</span> If <tt>t</tt> is a positional or a named-argument term of the form <tt>p(...)</tt>, then <tt>External(t)</tt> is considered to be a shorthand for <tt>External(t <p*>)</tt>, where <tt>p*</tt> is the IRI corresponding to <tt>p</tt> (for instance, if <tt>p</tt> is <tt>"http://example.com/foobar"^^rif:iri</tt> then <tt>p*</tt> is <tt>http://example.com/foobar</tt>).
</p>
</li>
<li>
<span class="anchor" id="ref-fld-formula-term">
<i>Formula term.</i></span>
If <tt>S</tt> is a connective or a quantifier symbol and <tt>t<sub>1</sub></tt>, ..., <tt>t<sub>n</sub></tt> are terms then <tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt> is a <i><b>formula term</b></i>.
<p>
Formula terms correspond to <i>compound formulas</i> in logic, i.e., formulas that are constructed from atomic formulas by combining them with connectives and quantifiers. For better visual appeal, some connectives (e.g., rule implication, <tt>:-</tt>, and default negation, <tt>Naf</tt>) may be written in infix or prefix form (e.g., <tt>a :- b</tt> and <tt>Naf a</tt>), but the above function application form is considered to be <i>canonical</i>.
</p>
<p>
Let <tt>φ</tt> be a formula term of the form <tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt>, where <tt>S</tt> is a quantifier, and let <tt>?X<sub>1</sub>,...,?X<sub>n</sub></tt> be a list of variables bound by <tt>S</tt>. We say that all occurrences of these variables are <i><b>bound</b></i> in the formula term <tt>φ</tt>.
In general, if <tt>τ</tt> is a term and <tt>ψ</tt> a formula term that occurs in <tt>τ</tt> then all occurrences of the variables that are bound in <tt>φ</tt> are also said to be bound in <tt>τ</tt>. The occurrences of variables in a term that are not bound are said to be <i><b>free</b></i>. A term that has no free occurrences of variables is <i><b>closed</b></i>.
</p>
</li>
<li>
<span class="anchor" id="ref-aggregate-term">
<i>Aggregate term.</i></span>
An <i><b>aggregate term</b></i> has the form <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub>(τ)</tt>, where <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub></tt> is an aggregate symbol, <tt>n≥0</tt>, and <tt>τ</tt> is a term. For readability, we will usually write aggregate terms as <tt><em>sym</em>{?V [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>. If <tt>n=0</tt>, we will omit the <tt>[...]</tt> part.
Note that aggregates can be nested, i.e., <tt>τ</tt> can contain aggregate terms.
<p>
In addition, it is required that the variables <tt>?V</tt>, <tt>?X<sub>1</sub></tt>, ..., <tt>?X<sub>n</sub></tt> have free occurrences in <tt>τ</tt>, and all occurrences of other variables in <tt>τ</tt> are bound.
</p>
<p>
The comprehension variable <tt>?V</tt> and the grouping variables <tt>?X<sub>1</sub></tt>, ..., <tt>?X<sub>n</sub></tt> of the symbol <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub></tt> are also said to be the comprehension and grouping variables of the above aggregate term.
The <em>comprehension variable</em> <tt>?V</tt> <em>is considered bound</em> by the aggregation term, but the <em>grouping variables</em> <tt>?X<sub>1</sub></tt>, ..., <tt>?X<sub>n</sub></tt> <em>remain free</em>.
</p>
<p>
As a practical convenience, dialects may allow more general terms in place of the comprehension variable, similarly to Prolog's <tt>findall/3</tt> built-in. In this case, <tt><em>sym</em>{Term [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt> is treated as a shorthand for <tt><em>sym</em>{?V [?X<sub>1</sub> ... ?X<sub>n</sub>] | And(τ ?V=Term)}</tt>.
</p>
</li>
<li>
<span class="anchor" id="ref-module-term">
<i>Remote term reference.</i>
</span>
A remote term reference (also called remote term) is a term of the form <tt>φ@r</tt> where <tt>φ</tt> is a term; <tt>r</tt> can be a constant, variable, a positional, or a named-argument term.
<p>
Remote terms are used to query remote RIF documents, called <i>remote modules</i>. Here <tt>φ</tt> is the actual query and <tt>r</tt> is a reference used to identify the remote module.
Remote terms should be contrasted with external terms, which are used to query external sources that are not RIF documents. Since remote terms refer to remote RIF documents, their semantics is defined by RIF-FLD. In contrast, external terms are used to query external opaque sources, which are not RIF documents. So, their semantics is opaque in RIF.
</p>
</li>
<li>
<span class="anchor" id="ref-newterm">
<i><tt>NEWTERM</tt>.</i>
</span>
This is not a specific kind of term, but an <a href="#ref-extension-point" title="">extension point</a>; dialects are supposed to replace it with zero or more new types of terms.
☐
</li>
</ol>
<p>The above definitions are very general. They make no distinction between constant symbols that represent individuals, predicates, and function symbols. The same symbol can occur in multiple contexts at the same time. For instance, if <tt>p</tt>, <tt>a</tt>, and <tt>b</tt> are symbols then <tt>p(p(a) p(a p c))</tt> is a term. Even variables and general terms are allowed to occur in the position of predicates and function symbols, so <tt>p(a)(?v(a c) p)</tt> is also a term.
</p><p>Furthermore, the extensible set of quantifiers and connectives allows dialects to introduce additional features, which could include modal operators, bounded quantification, rule labels, and so on. For instance, to add labels to formulas, as required by some rule languages, a dialect could introduce a new connective, <tt>Label</tt>, and formulas of the form <tt>Label(t φ)</tt>, where <tt>t</tt> could be a positional term and <tt>φ</tt> a formula term. (Note that RIF-FLD also supports a very general form of <a href="#sec-formal-syntax-metadata" title="">annotations</a>, which can be used to assign identifiers to rules. However, <a href="#sec-semantics-metadata" title="">annotations do not affect the semantics</a> of RIF dialects, so they cannot be used to label rules in dialects where rule labels do affect the semantics. It is in those cases that RIF dialect designers might choose to introduce a special connective, like <tt>Label</tt> above.)
</p><p>Frame, classification, and other terms can be freely nested, as exemplified by <tt>p(?X q#r[p(1,2)->s](d->e f->g))</tt>. Some language environments, like FLORA-2 [<a href="#ref-flora2" title="">FL2</a>], OO jDREW [<a href="#ref-oojdrew" title="">OOjD</a>], NxBRE [<a href="#ref-nxbre" title="">NxBRE</a>], and CycL [<a href="#ref-cycl" title="">CycL</a>] support fairly large (partially overlapping) subsets of RIF-FLD terms, but most languages support much smaller subsets. RIF dialects are expected to carve out the appropriate subsets of RIF-FLD terms, and the general form of the RIF logic framework allows a considerable degree of freedom.
</p><p>Observe that the argument names of frame terms, <tt>p<sub>1</sub></tt>, ..., <tt>p<sub>n</sub></tt>, are terms and, as a special case, can be variables. In contrast, terms with named arguments can use only the symbols from <tt>ArgNames</tt> to represent their argument names. They cannot be constants from <tt>Const</tt> or variables from <tt>Var</tt>. The reason for this restriction has to do with the complexity of unification, which is integral part of many inference rules underlying first-order logic. We are not aware of any rule language where terms with named arguments use anything more general than what is defined here.
</p><p>Dialects can restrict the contexts in which the various terms are allowed by using the mechanism of <a href="#sec-signature" title="">signatures</a>. The RIF-FLD language associates a signature with each symbol (both constant and variable symbols) and uses signatures to define <i>well-formed terms</i>. Each RIF dialect is expected to select appropriate signatures for the symbols in its alphabet, and only the terms that are well-formed according to the selected signatures are allowed in that particular dialect.
</p><p><br />
<b>Example 1</b> (Terms)
</p>
<ul>
<li>
Positional term: <tt>"http://example.com/ex1"^^rif:iri(1 "http://example.com/ex2"^^rif:iri(?X 5) "abc")</tt>
</li>
<li>
Term with named arguments: <tt>"http://example.com/Person"^^rif:iri(id->"http://example.com/John"^^rif:iri "http://example.com/age"^^rif:iri->?X "http://example.com/spouse"^^rif:iri->?Y)</tt>
</li>
<li>
Frame term: <tt>"http://example.com/John"^^rif:iri[age->?X spouse->?Y]</tt>
</li>
<li>
Lists
<ul>
<li>
Empty list: <tt>List()</tt>
</li>
<li>
Closed list with variable inside: <tt>List("a"^^rif:local ?Y "c"^^rif:local)</tt>
</li>
<li>
Open list with variables: <tt>List("a"^^rif:local ?Y "c"^^xs:string | ?Z)</tt>
</li>
<li>
Equality term with lists inside: <tt>List(?Head | ?Tail) = List("a"^^rif:local ?Y "c"^^xs:string)</tt>
</li>
<li>
Nested list: <tt>List("a"^^rif:local List(?X "b"^^rif:local) "c"^^xs:string)</tt>
</li>
</ul>
</li>
<li>
Classification terms
<ul>
<li>
Membership: <tt>?X # ?Y</tt>
</li>
<li>
Subclass: <tt>?X ## "http://example.com/ex1"^^rif:iri(?Y)</tt>
</li>
<li>
Membership: <tt>"http://example.com/John"^^rif:iri # "http://example.com/Person"^^rif:iri</tt>
</li>
<li>
Subclass: <tt>"http://example.com/Student"^^rif:iri ## "http://example.com/Person"^^rif:iri</tt>
</li>
</ul>
</li>
<li>
External term: <tt>External(pred:numeric-greater-than(?diffdays 10)))</tt>
</li>
<li>
Formula terms
<ul>
<li>
<tt>:-("p"^^rif:local(?X) ?X("q"^^xs:string))</tt> (usually written as <tt>"p"^^rif:local(?X) :- ?X("q"^^xs:string)</tt>)
</li>
<li>
<tt>Forall<sub>?X,?Y</sub>(Exists<sub>?Z</sub>("p"^^rif:local(?X ?Y ?Z)))</tt> (usually written as <tt>Forall ?X ?Y (Exists ?Z ("p"^^rif:local(?X ?Y ?Z)))</tt>
</li>
<li>
<tt>Or("http://example.com/to-be"^^rif:iri(?X) Neg("http://example.com/to-be"^^rif:iri(?X)))</tt>
</li>
</ul>
</li>
<li>
Aggregate term: <tt>avg{?Sal [?Dept]|Exists ?Empl "http://example.com/salary"^^rif:local(?Empl ?Dept ?Sal)}</tt>
</li>
<li>
Remote term: <tt>?O[?N -> "John"^^rif:string "http://example.com/salary"^^rif:iri -> ?S]@"http://acme.foo"^^xs:anyURI</tt>
</li>
</ul>
<p><br />
</p><p><span class="anchor" id="sec-formal-external-schema"></span>
</p>
<a id="Schemas_for_Externally_Defined_Terms" name="Schemas_for_Externally_Defined_Terms"></a><h4> <span class="mw-headline">2.5 Schemas for Externally Defined Terms </span></h4>
<p>This section introduces the notion of <i>external schemas</i>, which serve as templates for externally defined terms. These schemas determine which externally defined terms are acceptable in a RIF dialect. Externally defined terms include RIF built-ins, which are specified in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>], but are more general. They are designed to accommodate the ideas of procedural attachments and querying of external data sources. Because of the need to accommodate many different possibilities, the RIF logical framework supports a very general notion of an externally defined term. Such a term is not necessarily a function or a predicate -- it can be a frame, a classification term, and so on.
</p><p><span class="anchor" id="def-fld-external-schema"></span>
<b>Definition (Schema for external term).</b>
An <i><b>external schema</b></i> has the form <tt>(?X<sub>1</sub> ... ?X<sub>n</sub>; τ; loc)</tt> where
</p>
<ul>
<li>
<tt>loc</tt> is the <a href="#ref-ext-locator" title="">locator</a> for an external source.
</li>
<li>
<tt>τ</tt> is a <a href="#def-fld-term" title="">term</a> of one of these kinds: constant, positional, named-argument, equality, classification, frame.
</li>
<li>
<tt>?X<sub>1</sub> ... ?X<sub>n</sub></tt> is a list of all distinct variables that occur in <tt>τ</tt>
</li>
</ul>
<p>The names of the variables in an external schema are immaterial, but their order is important. For instance, <tt>(?X ?Y; ?X["foo"^^xs:string->?Y]; loc)</tt> and <tt>(?V ?W; ?V["foo"^^xs:string->?W]; loc)</tt> are considered to be indistinguishable, but <tt>(?X ?Y; ?X["foo"^^xs:string->?Y]; loc)</tt> and <tt>(?Y ?X; ?X["foo"^^xs:string->?Y]; loc)</tt> are viewed as different schemas.
</p><p>An external term <tt>External(t loc1)</tt> is an <i><b>instantiation</b></i> of an external schema <tt>(?X<sub>1</sub> ... ?X<sub>n</sub>; τ; loc)</tt> iff <tt>loc1=loc</tt> and <tt>t</tt> can be obtained from <tt>τ</tt> by a simultaneous substitution <tt>?X<sub>1</sub>/s<sub>1</sub> ... ?X<sub>n</sub>/s<sub>n</sub></tt> of the variables <tt>?X<sub>1</sub> ... ?X<sub>n</sub></tt> with terms <tt>s<sub>1</sub> ... s<sub>n</sub></tt>, respectively. Some of the terms <tt>s<sub>i</sub></tt> can be variables themselves. For example, <tt>External(?Z["foo"^^xs:string->f("a"^^rif:local ?P)] loc)</tt> is an instantiation of <tt>(?X ?Y; ?X["foo"^^xs:string->?Y]; loc)</tt> by the substitution <tt>?X/?Z ?Y/f("a"^^rif:local ?P)</tt>. ☐
</p><p>Observe that a variable cannot be an instantiation of an external schema, since <tt>τ</tt> in the above definition cannot be a variable. It will be seen later that this implies that a term of the form <tt>External(?X loc)</tt> is not well-formed in RIF.
</p><p>The intuition behind the notion of an external schema, such as <tt>(?X ?Y; ?X["foo"^^xs:string->?Y] <http://example.com/acme>)</tt> and <tt>(?V; pred:isTime(?V) <pred:isTime>)</tt>, is that <tt>?X["foo"^^xs:string->?Y]</tt> or <tt>pred:isTime(?V)</tt> are invocation patterns for querying external sources, and instantiations of those schemas correspond to concrete invocations. Thus, <tt>External("http://foo.bar.com"^^rif:iri["foo"^^xs:string->"123"^^xs:integer]" <http://example.com/acme>)</tt> and <tt>External(pred:isTime("22:33:44"^^xs:time)" <pred:isTime>)</tt> are examples of invocations of external terms -- one querying the external source identified by the IRI <tt>http://example.com/acme</tt> and the other invoking the built-in identified by the IRI <tt>pred:isTime</tt>.
</p><p>Recall that one-argument externals, such as <tt>External(t)</tt> are <a href="#ref-external-shorthand" title="">shortcuts for two-argument externals.</a> So, we define a one-argument external term to be an instantiation of an external schema iff its corresponding two-argument form is an instantiation of that schema.
</p><p><span class="anchor" id="def-fld-external-schema-set"></span>
<b>Definition (Coherent set of external schemas).</b>
A set Ε of external schemas is <i><b>coherent</b></i> if there is no term, <tt>t</tt>, that is an instantiation of two distinct schemas in Ε. ☐
</p><p>The intuition behind this notion is to ensure that any use of an external term is associated with at most one external schema. This assumption is relied upon in the definition of the semantics of externally defined terms. Note that the coherence condition is easy to verify syntactically and that it implies that schemas like <tt>(?X ?Y; ?X["foo"^^xs:string->?Y]; loc)</tt> and <tt>(?Y ?X; ?X["foo"^^xs:string->?Y]; loc)</tt>, which differ only in the order of their variables, cannot be in the same coherent set.
</p><p>It is important to keep in mind that external schemas are <i>not</i> part of the language in RIF, since they do not appear anywhere in RIF expressions. Instead, like signatures, which are defined below, they are best thought of as part of the grammar of the language. In particular, they will be used to determine which external terms, i.e., the terms of the form <tt>External(t loc)</tt> are <a href="#def-fld-well-formed-term" title="">well-formed</a>.
</p><p><br />
<span class="anchor" id="sec-signature"></span>
</p>
<a id="Signatures" name="Signatures"></a><h4> <span class="mw-headline">2.6 Signatures </span></h4>
<p>In this section we introduce the concept of a <i>signature</i>, which is a key mechanism that allows RIF-FLD to control the context in which the various symbols are allowed to occur. For instance, a symbol <tt>f</tt> with signature <tt>{(term term) => term, (term) => term}</tt> can occur in terms like
<tt>f(a b)</tt>, <tt>f(f(a b) a)</tt>, <tt>f(f(a))</tt>, etc., <i>if</i> <tt>a</tt> and <tt>b</tt> have signature <tt>term</tt>. But <tt>f</tt> is not allowed to appear in the context <tt>f(a b a)</tt> because there is no <tt>=></tt>-expression in the signature of <tt>f</tt> to support such a context.
</p><p>The above example provides intuition behind the use of signatures in RIF-FLD.
Much of the development, below, is inspired by [<a href="#ref-sorted-hilog-93" title="">CK95</a>]. It should be kept in mind that signatures are <i>not</i> part of the logic language in RIF, since they do not appear anywhere in RIF-FLD formulas. Instead they are part of the grammar: they are used to determine which sequences of tokens are in the language and which are not. The actual way by which signatures are assigned to the symbols of the language may vary from dialect to dialect. In some dialects (for example [<a href="#ref-rif-bld" title="">RIF-BLD</a>]), this assignment is derived from the context in which each symbol occurs and no separate language for signatures is used. Other dialects may choose to assign signatures explicitly. In that case, they would require a concrete language for signatures (which would be separate from the language for specifying the logic formulas of the dialect).
</p><p><span class="anchor" id="def-fld-signame"></span>
<b>Definition (Signature name).</b>
Let <tt>SigNames</tt> be a non-empty, partially-ordered finite or countably infinite set of symbols, called <i><b>signature names</b></i>. Since signatures are not part of the logic language, their names do not have to be disjoint from <tt>Const</tt>, <tt>Var</tt>, and <tt>ArgNames</tt>. We require that this set includes at least the following <i>reserved</i> signature names:
</p>
<ul><li> <tt>atomic</tt> -- used to represent the syntactic context where atomic formulas are allowed to appear.
</li><li> <tt>formula</tt> -- represents the context where formulas (atomic or composite) may appear.
</li><li> <tt>∞-connective</tt>-- the signature for the connectives, such as <tt>And</tt> and <tt>Or</tt>, that can take any number of arguments.
</li><li> <tt>2-connective</tt> -- the signature for the connectives, such as the rule implication connective <tt>:-</tt>, that take exactly two arguments.
</li><li> <tt>1-connective</tt> -- the signature for the connectives that take exactly one argument. In our case, this signature will be used for the negation connectives and the quantifiers <tt>Forall</tt> and <tt>Exists</tt>.
</li><li> <tt>=</tt> -- used for representing contexts where equality terms can appear.
</li><li> <tt>#</tt> -- a signature name reserved for membership terms.
</li><li> <tt>##</tt> -- a signature reserved for subclass terms.
</li><li> <tt>-></tt> -- a signature reserved for frame terms.
</li><li> <tt>aggregate</tt> -- a signature reserved for aggregate functions.
</li><li> <tt>remote</tt> -- a signature reserved for the symbol <tt>@</tt> that is used to build remote terms.
</li><li> <tt>list</tt> -- a signature reserved for the symbol <tt>List</tt> that is used to represent <a href="#def-list-term" title="">closed lists</a>.
</li><li> <tt>openlist</tt> -- a signature reserved for the symbol <tt>OpenList</tt> that is used to represent <a href="#def-list-term" title="">open lists</a>. ☐
</li></ul>
<p>Dialects may introduce additional signature names. For instance, RIF Basic Logic Dialect [<a href="#ref-rif-bld" title="">RIF-BLD</a>] introduces the signature name <tt>individual</tt>. The partial order on <tt>SigNames</tt> is dialect-specific; it is used in the definition of well-formed terms below.
</p><p>We use the symbol <tt><</tt> to represent the partial order on <tt>SigNames</tt>. Informally, <tt>α < β</tt> means that terms with signature <tt>α</tt> can be used wherever terms with signature <tt>β</tt> are allowed. We will write <tt>α ≤ β</tt> if either <tt>α = β</tt> or <tt>α < β</tt>.
</p><p><span class="anchor" id="def-fld-signature"></span>
<b>Definition (Signature).</b>
A <i><b>signature</b></i> has the form <tt>η{e<sub>1</sub>, ..., e<sub>n</sub>, ...}</tt> where <tt>η</tt> ∈ <tt>SigNames</tt> is the name of the signature and <tt>{e<sub>1</sub>, ..., e<sub>n</sub>, ...}</tt> is a countable set of <i>arrow expressions</i>. Such a set can thus be infinite, finite, or even empty. In RIF-BLD, signatures can have at most one arrow expression. Other dialects (such as one for HiLog [<a href="#ref-hilog-93" title="">CKW93</a>] and Relfun [<a href="#ref-relfun-99" title="">RF99</a>], for example) may require polymorphic symbols and thus allow signatures with more than one arrow expression in them.
</p><p>An <i><b>arrow expression</b></i> is defined as follows:
</p>
<ul>
<li>If <tt>κ</tt>, <tt>κ<sub>1</sub></tt>, ..., <tt>κ<sub>n</sub></tt> ∈ <tt>SigNames</tt>, <tt>n≥0</tt>, are signature names then <tt>(κ<sub>1</sub> ... κ<sub>n</sub>) ⇒ κ</tt> is a <i><b>positional arrow expression</b></i>.
<p>
For instance, <tt>() ⇒ individual</tt> and <tt>(individual) ⇒ individual</tt> are positional arrow expressions, if <tt>individual</tt> is a signature name.
</p>
</li>
<li>If <tt>κ</tt>, <tt>κ<sub>1</sub></tt>, ..., <tt>κ<sub>n</sub></tt> ∈ <tt>SigNames</tt>, <tt>n≥0</tt>, are signature names and <tt>p<sub>1</sub></tt>, ..., <tt>p<sub>n</sub></tt> ∈ <tt>ArgNames</tt> are argument names then <tt>(p<sub>1</sub>->κ<sub>1</sub> ... p<sub>n</sub>->κ<sub>n</sub>) => κ</tt> is an <i><b>arrow expression with named arguments</b></i>.
<p>
For instance, <tt>(arg1->individual arg2->individual) => individual</tt> is an arrow signature expression with named arguments. The order of the arguments in arrow expressions with named arguments is immaterial, so any permutation of arguments yields the same expression. ☐
</p>
</li>
</ul>
<p>RIF dialects are always associated with sets of coherent signatures, defined next. The overall idea is that a coherent set of signatures must include all the predefined signatures (such as signatures for equality and classification terms) and the signatures included in a coherent set must not conflict with each other. For instance, two different signatures should not have identical names and if one signature is said to extend another then the arrow expressions of the supersignature should be included among the arrow expressions of the subsignature (a kind of an arrow expression "inheritance").
</p><p><span class="anchor" id="def-fld-coherent-signature"></span>
<b>Definition (Coherent signature set).</b>
A set <b>Σ</b> of signatures is <i><b>coherent</b></i> iff
</p>
<ol>
<li><b>Σ</b> contains the special signatures <tt>atomic{ }</tt> and <tt>formula{ }</tt>, which represent the context of atomic formulas and more generally, composite formulas, respectively. Furthermore, it is required that <tt>atomic < formula</tt>.
</li>
<li>
<b>Σ</b> contains the special signature <tt>∞-connective{e<sub>1</sub>, ..., e<sub>n</sub>, ...}</tt>, where each <tt>e<sub>n</sub></tt> has the form
<tt>(formula ... formula) ⇒ formula</tt> (the left-hand side of this signature is a sequence of <tt>n</tt> symbols <tt>formula</tt>).
This signature is assigned to the connectives <tt>And</tt> and <tt>Or</tt>.
</li>
<li>
<b>Σ</b> contains the special signature <tt>2-connective{(formula formula) ⇒ formula}</tt>. This signature is assigned to the rule implication connective.
</li>
<li>
<b>Σ</b> contains the signature <tt>1-connective{(formula) ⇒ formula}</tt>. This signature is assigned to the negation connectives <tt>Naf</tt> and <tt>Neg</tt>, and to the reserved quantifiers of RIF-FLD, <tt>Exists<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> and <tt>Forall<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt>, for all variable sequences <tt>?X<sub>1</sub>,...,?X<sub>n</sub></tt> and <tt>n ≥ 0</tt>.
</li>
<li><b>Σ</b> contains the signature <tt>={e<sub>1</sub>, ..., e<sub>n</sub>, ...}</tt> for the equality symbol.
<p>
All arrow expressions <tt>e<sub>i</sub></tt> here have the form <tt>(κ κ) ⇒ γ</tt> (the arguments in an equation must be compatible) and at least one of these expressions must have the form <tt>(κ κ) ⇒ atomic</tt> (i.e., equation terms are also atomic formulas). Dialects may further specialize this signature.
</p>
</li>
<li>
<b>Σ</b> contains the signature <tt>#{e<sub>1</sub>, ..., e<sub>n</sub>...}</tt> for membership terms.
<p>
Here all arrow expressions <tt>e<sub>i</sub></tt> are binary (have two arguments) and at least one has the form <tt>(κ γ) ⇒ atomic</tt>. Dialects may further specialize this signature.
</p>
</li>
<li><b>Σ</b> contains the signature <tt>##{e<sub>1</sub>, ..., e<sub>n</sub>...}</tt> for subclass terms.
<p>
Here all arrow expressions <tt>e<sub>i</sub></tt> have the form <tt>(κ κ) ⇒ γ</tt> (the arguments must be compatible) and at least one of these arrow expressions has the form <tt>(κ κ) ⇒ atomic</tt>. Dialects may further specialize this signature.
</p>
</li>
<li><b>Σ</b> contains the signature <tt>->{e<sub>1</sub>, ..., e<sub>n</sub>...}</tt> for frames.
<ul>
<li>
Here all arrow expressions <tt>e<sub>i</sub></tt> are ternary (have three arguments) and at least one of them is of the form <tt>(κ<sub>1</sub> κ<sub>2</sub> κ<sub>3</sub>) ⇒ atomic</tt>. Dialects may further specialize this signature.
</li>
</ul>
</li>
<li>
<b>Σ</b> contains the signatures <tt>list</tt> and <tt>openlist</tt> for representing list terms.
<ul>
<li>
The signature <tt>list</tt>, for closed lists, has arrow expressions of the form <tt>() ⇒ κ</tt>, <tt>(κ) ⇒ κ</tt>, <tt>(κ κ) ⇒ κ</tt>, and so on, where <tt>κ</tt> is a signature.
</li>
<li>
The signature <tt>openlist</tt>, for open lists, has arrow expressions of the form <tt>(κ κ) ⇒ κ</tt>, <tt>(κ κ κ) ⇒ κ</tt>, and so on, where <tt>κ</tt> is a signature.
</li>
</ul>
</li>
<li>
<b>Σ</b> contains the signature <tt>aggregate{e<sub>1</sub>, e<sub>2</sub>, ...}</tt> for aggregate terms.
<p>
Here each arrow expression <tt>e<sub>i</sub></tt> has the form <tt>(formula) ⇒ κ<sub>i</sub></tt>, for some signatures <tt>κ<sub>1</sub></tt>, <tt>κ<sub>2</sub></tt>, ....
</p>
</li>
<li>
<b>Σ</b> contains the signature <tt>remote{e<sub>1</sub>, e<sub>2</sub>, ...}</tt>, where at least one of the <tt>e<sub>i</sub></tt> is an arrow expression of the form <tt>(formula κ) ⇒ formula</tt> for some signature <tt>κ</tt>. This signature is assigned to the remote term symbol <tt>@</tt>.
</li>
<li>
<b>Σ</b> has at most one signature for any given signature name.
</li>
<li>
Whenever <b>Σ</b> contains a pair of signatures, <tt>ηA</tt> and <tt>κB</tt>, such that <tt>η<κ</tt> then <tt>B</tt>⊆<tt>A</tt>.
<p>
Here <tt>ηA</tt> denotes a signature with the name <tt>η</tt> and the associated set of arrow expressions <tt>A</tt>; similarly <tt>κB</tt> is a signature named <tt>κ</tt> with the set of expressions <tt>B</tt>. The requirement that <tt>B</tt>⊆<tt>A</tt> ensures that symbols that have signature <tt>η</tt> can be used wherever the symbols with signature <tt>κ</tt> are allowed. ☐
</p>
</li>
</ol>
<p><br />
The requirement that coherent sets of signatures must include the signatures for <tt>=</tt>, <tt>#</tt>, <tt>-></tt>, and so on is just a technicality that simplifies definitions. Some of these signatures may go "unused" in a dialect even though, technically speaking, they must be present in the signature set associated with that dialect. If a dialect disallows equality, classification terms, or frames in its syntax then the corresponding signatures will remain unused. Such restrictions can be imposed by specializing RIF-FLD -- see Section <a href="#sec-dialect-syntax" title="">Syntax of a RIF Dialect as a Specialization of RIF-FLD</a>.
</p><p>An <i>incoherent</i> set of signatures would be exemplified by one that includes signatures <tt>mysig{() ⇒ atomic}</tt> and <tt>mysig{(atomic) ⇒ atomic}</tt> because it has two different signatures with the same name. Likewise, if a set contains <tt>mysig<sub>1</sub>{() ⇒ atomic}</tt> and <tt>mysig<sub>2</sub>{(atomic) ⇒ atomic}</tt> and <tt>mysig<sub>1</sub> < mysig<sub>1</sub></tt> then it is incoherent because the set of arrow expressions of <tt>mysig<sub>1</sub></tt> does not contain the set of arrow expressions of <tt>mysig<sub>2</sub></tt>.
</p><p><br />
<span class="anchor" id="sec-fld-language"></span>
</p>
<a id="Presentation_Syntax_of_a_RIF_Dialect" name="Presentation_Syntax_of_a_RIF_Dialect"></a><h4> <span class="mw-headline">2.7 Presentation Syntax of a RIF Dialect </span></h4>
<p>The <i><b>presentation syntax of a RIF dialect</b></i> is a set of <a href="#sec-fld-wff" title="">well-formed formulas</a>, as defined in the next section. The language of the dialect is determined by the following parameters (see <a href="#sec-dialect-syntax" title="">Syntax of a RIF Dialect as a Specialization of RIF-FLD</a>):
</p>
<ul>
<li> An <a href="#def-fld-alphabet" title="">alphabet</a>.</li>
<li> A set of <a href="#def-fld-symspace" title="">symbol spaces</a>.</li>
<li> An assignment of signatures from a <a href="#def-fld-coherent-signature" title="">coherent set of signatures</a> to the symbols in <tt>Var</tt>, <tt>Const</tt>, connectives, and quantifiers:
<p>
Each variable symbol is associated with <i>exactly one</i> signature from a coherent set of signatures. A constant symbol can have <i>one or more</i> signatures, and different symbols can be associated with the same signature. (Variables are not allowed to have multiple signatures because then well-formed terms would not be closed under substitutions. For instance, a term like <tt>f(?X,?X)</tt> could be well-formed, but <tt>f(a,a)</tt> could be ill-formed.)
</p>
</li>
<li>
Restrictions on the classes of terms allowed in the language of the dialect.
</li>
<li>
Restrictions on the classes of formulas allowed in the language of the dialect.
</li>
<li>A <a href="#def-fld-external-schema-set" title="">coherent set of external schemas</a>.</li>
</ul>
<p>We have already seen how the alphabet and the symbol spaces are used to define <a href="#def-fld-term" title="">RIF terms</a>. The next section shows how signatures and external schemas are used to further specialize this notion to define <i>well-formed</i> RIF-FLD terms.
</p><p>Note that the signatures for RIF-FLD connectives are fixed. Therefore, when defining a dialect, there is no need to repeat the definitions of <tt>1-connective</tt>, <tt>2-connective</tt>, etc. However, since the same symbol can be given several signatures, the syntactic context of connectives can be expanded by assigning more signatures to them. For instance, if a dialect allows rules to be <em>reified</em> and treated as objects, one could add another signature to <tt>:-</tt> with the arrow expression <tt>(formula formula) ⇒ individual</tt>, assuming that <tt>individual</tt> is a suitably chosen signature (e.g., one that is assigned to variables or a subsignature of the variable's signature).
</p><p>In contrast, the signatures for equality, frames, etc., are not completely fixed and have to be explicitly specialized by the dialects. For instance, in the arrow expression <tt>(κ κ) ⇒ atomic</tt> for the equality symbol, one has to tell what <tt>κ</tt> exactly is. Since this kind of signatures must be explicitly defined by the dialects anyway, the dialect designer is allowed to add additional arrow expressions to them. If, for instance, a dialect designer would like to allow reification of the equality statements, the signature for <tt>=</tt> could be defined as <tt>={(individual individual) ⇒ atomic, (individual individual) ⇒ individual}</tt>.
</p><p><br />
<span class="anchor" id="sec-fld-wff"></span>
</p>
<a id="Well-formed_Terms_and_Formulas" name="Well-formed_Terms_and_Formulas"></a><h4> <span class="mw-headline">2.8 Well-formed Terms and Formulas </span></h4>
<p>Since signature names uniquely identify signatures in coherent signature sets, we will often refer to signatures simply by their names. For instance, if one of <tt>f</tt>'s signatures is <tt>atomic{ }</tt>, we may simply say that symbol <tt>f</tt> <i>has</i> signature <tt>atomic</tt>.
</p><p><br />
<span class="anchor" id="def-fld-well-formed-term"></span>
<b>Definition (Well-formed term).</b>
</p>
<ol>
<li>A <i>constant</i> or <i>variable</i> symbol with signature <tt>η</tt> is a well-formed term with signature <tt>η</tt>.
</li>
<li>A <i>positional term</i> <tt>t(t<sub>1</sub> ... t<sub>n</sub>)</tt>, <tt>0≤n</tt>, is well-formed and has a signature <tt>σ</tt> iff
<ul>
<li><tt>t</tt> is a well-formed term that has a signature that contains an arrow expression of the form <tt>(σ<sub>1</sub> ... σ<sub>n</sub>) ⇒ σ</tt>; and
</li>
<li>Each <tt>t<sub>i</sub></tt> is a well-formed term whose signature is <tt>γ<sub>i</sub></tt> such that <tt>γ<sub>i</sub>, ≤ σ<sub>i</sub></tt>.
</li>
</ul>
<p>
As a special case, when <tt>n=0</tt> we obtain that <tt>t()</tt> is a well-formed term with signature <tt>σ</tt>, if <tt>t</tt>'s signature contains the arrow expression <tt>() ⇒ σ</tt>.
</p>
</li>
<li>A <i>term with named arguments</i> <tt>t(p<sub>1</sub>->t<sub>1</sub> ... p<sub>n</sub>->t<sub>n</sub>)</tt>, <tt>0≤n</tt>, is well-formed and has a signature <tt>σ</tt> iff
<ul>
<li><tt>t</tt> is a well-formed term that has a signature that contains an arrow expression with named arguments of the form <tt>(p<sub>1</sub>->σ<sub>1</sub> ... p<sub>n</sub>->σ<sub>n</sub>) ⇒ σ</tt>; and
</li>
<li>
Each <tt>t<sub>i</sub></tt> is a well-formed term whose signature is <tt>γ<sub>i</sub></tt>, such that <tt>γ<sub>i</sub> ≤ σ<sub>i</sub></tt>.
</li>
</ul>
<p>
As a special case, when <tt>n=0</tt> we obtain that <tt>t()</tt> is a well-formed term with signature <tt>σ</tt>, if <tt>t</tt>'s signature contains the arrow expression <tt>() ⇒ σ</tt>.
</p>
</li>
<li>
An <i>equality term</i> of the form <tt>t<sub>1</sub>=t<sub>2</sub></tt> is well-formed and has a signature <tt>κ</tt> iff
<ul>
<li>
The signature <tt>=</tt> has an arrow expression <tt>(σ σ) ⇒ κ</tt>
</li>
<li>
<tt>t<sub>i</sub></tt> and <tt>t<sub>2</sub></tt> are well-formed terms with signatures <tt>γ<sub>1</sub></tt> and <tt>γ<sub>2</sub></tt>, respectively, such that <tt>γ<sub>i</sub> ≤ σ</tt>, <tt>i=1,2</tt>.
</li>
</ul>
</li>
<li>A <i>membership term</i> of the form <tt>t<sub>1</sub>#t<sub>2</sub></tt> is well-formed and has a signature <tt>κ</tt> iff
<ul>
<li>The signature <tt>#</tt> has an arrow expression <tt>(σ<sub>1</sub> σ<sub>2</sub>) ⇒ κ</tt>
</li>
<li>
<tt>t<sub>1</sub></tt> and <tt>t<sub>2</sub></tt> are well-formed terms with signatures <tt>γ<sub>1</sub></tt> and <tt>γ<sub>2</sub></tt>, respectively, such that <tt>γ<sub>i</sub> ≤ σ<sub>i</sub></tt>, <tt>i=1,2</tt>.
</li>
</ul>
</li>
<li>A <i>subclass term</i> of the form <tt>t<sub>1</sub>##t<sub>2</sub></tt> is well-formed and has a signature <tt>κ</tt> iff
<ul>
<li>The signature <tt>##</tt> has an arrow expression <tt>(σ σ) ⇒ κ</tt>
</li>
<li><tt>t<sub>1</sub></tt> and <tt>t<sub>2</sub></tt> are well-formed terms with signatures <tt>γ<sub>1</sub></tt> and <tt>γ<sub>2</sub></tt>, respectively, such that <tt>γ<sub>i</sub> ≤ σ</tt>, <tt>i=1,2</tt>.
</li>
</ul>
</li>
<li>A <i>frame term</i> of the form <tt>t[s<sub>1</sub>->v<sub>1</sub> ... s<sub>n</sub>->v<sub>n</sub>]</tt> is well-formed and has a signature <tt>κ</tt> iff
<ul>
<li>The signature <tt>-></tt> has arrow expressions <tt>(σ σ<sub>11</sub> σ<sub>12</sub>) ⇒ κ, ..., (σ σ<sub>n1</sub> σ<sub>n2</sub>) ⇒ κ</tt> (these <tt>n</tt> expressions need not be distinct).
</li>
<li>
<tt>t</tt>, <tt>s<sub>j</sub></tt>, and <tt>v<sub>j</sub></tt> are well-formed terms with signatures <tt>γ</tt>, <tt>γ<sub>j1</sub></tt>, and <tt>γ<sub>j2</sub></tt>, respectively, such that <tt>γ ≤ σ</tt> and <tt>γ<sub>ji</sub> ≤ σ<sub>ji</sub></tt>, where <tt>j=1,...,n</tt> and <tt>i=1,2</tt>.
</li>
</ul>
</li>
<li>
An <i>externally defined term</i>, <tt>External(t loc)</tt>, is well-formed and has signature <tt>κ</tt> iff
<ul>
<li>
<tt>t</tt> is well-formed and has signature <tt>κ</tt>.
</li>
<li>
<tt>External(t loc)</tt> is an <a href="#def-fld-external-schema" title="">instantiation of an external schema</a> that belongs to a <a href="#def-fld-external-schema-set" title="">coherent set of external schemas</a> of the <a href="#sec-fld-language" title="">language</a>.
<p>
Note that, according to the definition of coherent sets of schemas, a term can be an instantiation of at most one external schema. ☐
</p>
</li>
</ul>
</li>
<li>
A <i>formula term</i> of the form <tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt>, <tt>0≤n</tt> is well-formed if <tt>S</tt> is a connective or a quantifier whose signature has an arrow expression <tt>(σ<sub>1</sub> ... σ<sub>n</sub>) ⇒ formula</tt> and each <tt>t<sub>i</sub></tt> is a well-formed term whose signature is <tt>≤ σ<sub>i</sub></tt>.
<p>
In the special case of our reserved connectives and quantifiers, <tt>t<sub>1</sub>, ..., t<sub>n</sub></tt> must have signatures that are below <tt>formula</tt> (i.e., <tt>≤ formula</tt>). Also, if <tt>S</tt> is <tt>:-</tt> then <tt>n</tt> must be equal <tt>2</tt> and if <tt>S</tt> is <tt>Neg</tt>, <tt>Naf</tt>, <tt>Forall</tt>, or <tt>Exists</tt> then <tt>n=1</tt>.
</p>
</li>
<li>
An <i>aggregate term</i> of the form <tt><em>sym</em>{?V [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt> is well formed if the aggregate symbol <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub></tt> is assigned signature <tt>aggregate</tt> and the term <tt><em>sym</em><sub> ?V[?X<sub>1</sub> ... ?X<sub>n</sub>]</sub>(τ)</tt> is well-formed (as a positional term).
<p>
This implies that <tt>τ</tt> must have the signature <tt>formula</tt> or <tt>< formula</tt>. Unless a dialect introduces additional signatures, this also means that <tt>τ</tt> must be a formula term (i.e., a compound formula) or an atomic formula (see below).
</p>
</li>
<li>
A <i>remote term</i> of the form <tt>φ@r</tt> is well-formed if the positional term <tt>@(φ r)</tt> is well-formed. This implies that <tt>φ</tt> must be well-formed and have the signature <tt>formula</tt>, that <tt>r</tt> must a well-formed term, and that the term <tt>φ@r</tt> itself has the signature <tt>formula</tt> (and, possibly, others).
</li>
</ol>
<p>Note that, like the constant symbols, well-formed terms can have more than one signature. Also note that, according to the above definition, <tt>f()</tt> and <tt>f</tt> are distinct terms.
</p><p><br />
<span class="anchor" id="def-fld-well-formed-formula"></span>
<b>Definition (Well-formed formula).</b>
A <i><b>well-formed atomic formula</b></i> is a well-formed term one of whose signatures is <tt>atomic</tt> or <tt>< atomic</tt> (less than <tt>atomic</tt> in the order <tt><</tt>).
Note that equality, membership, subclass, and frame terms are atomic formulas, since <tt>atomic</tt> is one of their signatures.
A <i><b>well-formed formula</b></i> is
</p>
<ul><li> A well-formed term whose signature is <tt>formula</tt> or <tt>< formula</tt>; or
</li><li> A <i>group</i> formula; or
</li><li> A <i>document</i> formula.
</li></ul>
<p>Group and document formulas are defined below. For clarity, we will also give explicit definitions of conjunctive, disjunctive, rule, and other formulas even though they were already defined as special cases of the definition of well-formed formula terms (the first of the above bullets). Recall that all terms have a canonical function application form, but some are also written in a more familiar infix or prefix forms. For instance, rule implication, <tt>a :- b</tt>, has the canonical form <tt>:-(a b)</tt> and the canonical form for negation, <tt>Naf p</tt> and <tt>Neg p</tt>, is <tt>Naf(p)</tt> and <tt>Neg(p)</tt>.
</p>
<ol>
<li>
<i>Atomic</i>: If <tt>φ</tt> is a well-formed atomic formula then it is also a well-formed formula.
</li>
<li>
<i>Remote</i>: A well-formed remote term <tt>φ@r</tt> is also a well-formed formula.
</li>
<li><i>Conjunction</i>: If <tt>φ<sub>1</sub></tt>, ..., <tt>φ<sub>n</sub></tt>, <tt>n ≥ 0</tt>, are well-formed formula terms then so is <tt>And(φ<sub>1</sub> ... φ<sub>n</sub>)</tt>.
<p>
As a special case, <tt>And()</tt> is allowed and is treated as a tautology, i.e., a formula that is always true.
</p>
</li>
<li><i>Disjunction</i>: If <tt>φ<sub>1</sub></tt>, ..., <tt>φ<sub>n</sub></tt>, <tt>n ≥ 0</tt>, are well-formed formula terms then so is <tt>Or(φ<sub>1</sub> ... φ<sub>n</sub>)</tt>.
<p>
As a special case, <tt>Or()</tt> is treated as a contradiction, i.e., a formula that is always false.
</p>
</li>
<li><i>Symmetric negation</i>: If <tt>φ</tt> is a well-formed formula term then so is <tt>Neg φ</tt>.
</li>
<li><i>Default negation</i>: If <tt>φ</tt> is a well-formed formula term then so is <tt>Naf φ</tt>.
</li>
<li><i>Rule implication</i>: If <tt>φ</tt> and <tt>ψ</tt> are well-formed formula terms then so is <tt>φ :- ψ</tt>.
</li>
<li>
<i>Constraint</i>: If <tt>ψ</tt> is a well-formed formula term then so is <tt> :- ψ</tt>.
<p>
This type of formulas is also known as an <i>error-producing constraint</i>. The intent is that the constraint formula is satisfied if the premise <tt>ψ</tt> is false. Constraints can also be viewed as rule implications whose conclusion is false.
</p>
</li>
<li><i>Universal and existential quantification</i>: If <tt>φ</tt> is a well-formed formula term then
<ul>
<li><tt>Forall ?V<sub>1</sub> ... ?V<sub>n</sub>(φ)</tt> </li>
<li><tt>Exists ?V<sub>1</sub> ... ?V<sub>n</sub>(φ)</tt></li>
</ul>
<p>
are well-formed formula terms. Recall that <tt>Forall<sub>?V<sub>1</sub>,...,?V<sub>n</sub></sub></tt> and <tt>Exists<sub>?V<sub>1</sub>,...,?V<sub>n</sub></sub></tt> are the reserved universal and existential quantifiers, respectively. The notation <tt>Forall ?V<sub>1</sub> ... ?V<sub>n</sub>(φ)</tt> is an alternative for <tt>Forall<sub>?V<sub>1</sub>,...,?V<sub>n</sub></sub>(φ)</tt>, and similarly for <tt>Exists</tt>.
</p>
</li>
<li>
<i>Group</i>: If <tt>φ<sub>1</sub></tt>, ..., <tt>φ<sub>n</sub></tt> are well-formed formula terms or <tt>Group</tt>-formulas then <tt>Group(φ<sub>1</sub> ... φ<sub>n</sub>)</tt> is a well-formed <i>group formula</i>. As a special case, the empty group formula, <tt>Group()</tt>, is well-formed and is treated as a tautology, i.e., a well-formed formula that is always true.
<p>
Non-empty group formulas are intended to represent sets of formulas. Note that some of the <tt>φ<sub>i</sub></tt>'s can themselves be group formulas, which means that groups can be nested.
</p>
</li>
<li>
<i>Document</i>: An expression of the form <tt>Document(<em>directive<sub>1</sub></em> ... <em>directive<sub>n</sub></em> Γ)</tt> is a well-formed <i>document formula</i>, if
<ul>
<li>
<tt>Γ</tt> is an optional well-formed group formula; it is called the group formula <span id="def-associated-group"><i>associated</i></span> with the document.
</li>
<li>
<em>directive<sub>1</sub></em>, ..., <em>directive<sub>n</sub></em> is an optional sequence of <i>directives</i>. A directive can be a <i>dialect directive</i>, a <i>base directive</i>, a <i>prefix directive</i>, an <i>import directive</i>, or a <i>remote module directive</i>.
<ul>
<li>
A <i><b>dialect directive</b></i> has the form <tt>Dialect(<i>D</i>)</tt>, where <i>D</i> is a Unicode string that specifies the name of a dialect. This directive specifies the dialect of a RIF document. Some dialects may require this directive in all of its documents, while others (notably, RIF-BLD) may not allow it and instead may entirely rely on other syntax. (Purely syntactic identification may not always be possible for dialects that are syntactically identical but semantically different, such as deductive databases with stable model semantics [<a href="#ref-stable-model" title="">GL88</a>] and with well-founded semantics [<a href="#ref-wf-model" title="">GRS91</a>]. These two dialects are examples where the <tt>Dialect</tt> directive might be necessary.)
</li>
<li>
A <i><b>base directive</b></i> has the form <tt>Base(<iri>)</tt>, where <tt>iri</tt> is a Unicode string in the form of an absolute IRI.
<p>
The <tt>Base</tt> directive defines a syntactic shortcut for expanding relative IRIs into full IRIs, as described in Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-symbol-spaces" title="DTB">Constants and Symbol Spaces</a> of [<a href="#ref-rif-dtb" title="">RIF-DTB</a>].
</p>
</li>
<li>
A <i><b>prefix directive</b></i> has the form <tt>Prefix(p <v>)</tt>, where <tt>p</tt> is an alphanumeric string that serves as the prefix name and <tt>v</tt> is an expansion for <tt>p</tt> -- a string that forms an IRI.
(An alphanumeric string is a sequence of ASCII characters, where each character is a letter, a digit, or an underscore "_", and the first character is a letter.)
<p>
Like the <tt>Base</tt> directive, the <tt>Prefix</tt> directives define shorthands to allow more concise representation of <tt>rif:iri</tt> constants. This mechanism is explained in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>], Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-symbol-spaces" title="DTB">Constants and Symbol Spaces</a>.
</p>
</li>
<li>
<span class="anchor" id="ref-import-directive">An <i><b>import directive</b></i></span> can have one of these two forms: <tt>Import(loc)</tt> or <tt>Import(loc p)</tt>.
<p>
Here <tt>loc</tt> is a <span class="anchor" id="ref-locator"><i><b>locator</b></i></span> that uniquely identifies some other document, which is to be imported. The exact form of the locator <tt>loc</tt>, the protocol that associates locators with documents, and the type of the imported documents is left to dialects to specify. However, all dialects must support the form <tt><IRI></tt>, where <tt>IRI</tt> is a sequence of Unicode characters that forms an IRI.
The second argument to <tt>Import</tt>, <tt>p</tt>, is a sequence of Unicode characters called the <i>profile of import</i>.
</p>
<p>
RIF-FLD gives a semantics only to the one-argument directive <tt>Import(loc)</tt>. The two-argument directive <tt>Import(loc p)</tt> is reserved for RIF dialects, which can use it to import non-RIF logical entities, such as RDF data and OWL ontologies [<a href="#ref-rif-swc" title="">RIF-RDF+OWL</a>]. The profile can specify what kind of entity is being imported and under what semantics. For instance, the various RDF entailment regimes are specified in [<a href="#ref-rif-swc" title="">RIF-RDF+OWL</a>] as profiles that have the form of Unicode strings that form IRIs.
</p>
</li>
<li>
A <i><b>remote module directive</b></i> has the form <tt>Module(n loc)</tt>. Here <tt>n</tt> is a variable-free term that represents the internal name of the remote module linked to the document -- it is the name under which the module is referenced in the document. The second argument, <tt>loc</tt>, is a <a href="#ref-locator" title="">locator</a> for the document that contains the rules and the data of the module.
<p>
As with <tt>Import</tt>, RIF-FLD does not restrict <tt>n</tt> and <tt>loc</tt> syntactically any further. However, we shall see that it does impose semantic restrictions on <tt>n</tt>, and <tt>loc</tt> is required to uniquely identify an existing RIF document. The exact protocol that is used to associate <tt>loc</tt> with documents and the type of those documents is left to dialects.
</p>
</li>
</ul>
<p>
Note that although <tt>Base</tt>, <tt>Prefix</tt>, and <tt>Import</tt> all make use of symbols of the form <tt><iri></tt> to indicate the connection of these symbols to IRIs, these symbols are <em>not</em> <tt>rif:iri</tt> constants, as semantically they are interpreted in a way that is quite different from constants.
</p>
<p>
A document formula can contain at most one <tt>Dialect</tt> and at most one <tt>Base</tt> directive. The <tt>Dialect</tt> directive, if present, must be first, followed by an optional <tt>Base</tt> directive, followed by any number of <tt>Prefix</tt> directives, followed by any number of <tt>Import</tt> directives, followed by any number of <tt>Module</tt> directives.
</p>
</li>
</ul>
</li>
</ol>
<p>
In the definition of a formula, the component formulas <tt>φ</tt>, <tt>φ<sub>i</sub></tt>, <tt>ψ<sub>i</sub></tt>, and <tt>Γ</tt> are said to be <span class="anchor" id="def-subformula"><i><b>subformulas</b></i></span> of the respective formulas (conjunction, disjunction, negation, implication, group, etc.) that are built using these components. ☐
</p>
<p>Observe that the restrictions in (1) -- (8) above imply that groups and documents cannot be nested inside formula terms and documents cannot be nested inside groups.
</p><p><br />
</p>
<p>
<b>Example 2</b> (Signatures, well-formed terms and formulas).
</p>
<p>We illustrate the above definitions with the following examples. In addition to <tt>atomic</tt>, let there be another signature, <tt>term{ }</tt>, which is intended here to represent the context of the arguments to positional function or atomic formulas.
</p><p>Consider the term <tt>p(p(a) p(a b c))</tt>. If <tt>p</tt> has the (polymorphic) signature <tt>mysig</tt>{(<tt>individual</tt>)⇒<tt>individual</tt>, (<tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>, (<tt>individual</tt> <tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>} and <tt>a</tt>, <tt>b</tt>, <tt>c</tt> each has the signature <tt>individual{ }</tt> then <tt>p(p(a) p(a b c))</tt> is a well-formed term with signature <tt>individual{ }</tt>. If instead <tt>p</tt> had the signature <tt>mysig2</tt>{(<tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>, (<tt>individual</tt> <tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>} then <tt>p(p(a) p(a b c))</tt> would not be a well-formed term since then <tt>p(a)</tt> would not be well-formed (in this case, <tt>p</tt> would have no arrow expression which allows <tt>p</tt> to take just one argument).
</p><p>For a more complex example, let <tt>r</tt> have the signature <tt>mysig3</tt>{(<tt>individual</tt>)⇒<tt>atomic</tt>, (<tt>atomic</tt> <tt>individual</tt>)⇒<tt>individual</tt>, (<tt>individual</tt> <tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>}. Then <tt>r(r(a) r(a b c))</tt> is well-formed. The interesting twist here is that <tt>r(a)</tt> is an atomic formula that occurs as an argument to a function symbol. However, this is allowed by the arrow expression (<tt>atomic</tt> <tt>individual</tt>)⇒ <tt>individual</tt>, which is part of <tt>r</tt>'s signature. If <tt>r</tt>'s signature were <tt>mysig4</tt>{(<tt>individual</tt>)⇒<tt>atomic</tt>, (<tt>atomic</tt> <tt>individual</tt>)⇒<tt>atomic</tt>, (<tt>individual</tt> <tt>individual</tt> <tt>individual</tt>)⇒<tt>individual</tt>} instead, then <tt>r(r(a) r(a b c))</tt> would be not only a well-formed term, but also a well-formed atomic formula.
</p><p>An even more interesting example arises when the right-hand side of an arrow expression is something other than <tt>individual</tt> or <tt>atomic</tt>. For instance, let <tt>John</tt>, <tt>Mary</tt>, <tt>NewYork</tt>, and <tt>Boston</tt> have signatures <tt>individual{ }</tt>; <tt>flight</tt> and <tt>parent</tt> have signature <tt>h<sub>2</sub>{(individual individual)⇒atomic}</tt>; and <tt>closure</tt> has signature <tt>hh<sub>1</sub>{(h<sub>2</sub>)⇒p<sub>2</sub>}</tt>, where <tt>p<sub>2</sub></tt> is the name of the signature <tt>p<sub>2</sub>{(individual individual)⇒atomic}</tt>. Then <tt>flight(NewYork Boston)</tt>, <tt>closure(flight)(NewYork Boston)</tt>, <tt>parent(John Mary)</tt>, and <tt>closure(parent)(John Mary)</tt> would be well-formed formulas. Such formulas are allowed in languages like HiLog [<a href="#ref-hilog-93" title="">CKW93</a>], which support predicate constructors like <tt>closure</tt> in the above example. ☐
</p><p><br />
<span class="anchor" id="sec-formal-syntax-metadata"></span>
</p>
<a id="Annotations_in_the_Presentation_Syntax" name="Annotations_in_the_Presentation_Syntax"></a><h4> <span class="mw-headline">2.9 Annotations in the Presentation Syntax </span></h4>
<p>RIF-FLD allows every term and formula (including terms and formulas that occur inside other terms and formulas) to be optionally preceded by <i>one</i> <i><b>annotation</b></i> of the form <tt>(* id φ *)</tt> where <tt>id</tt> is a constant and <tt>φ</tt> is a RIF formula that is not a document-formula. Both items inside the annotation are optional. The <tt>id</tt> part represents the identifier of the term (or formula) to which the annotation is attached and <tt>φ</tt> is the rest of the annotation. RIF-FLD does not impose any restrictions on <tt>φ</tt> apart from what is stated above. This means that <tt>φ</tt> may include variables, function symbols, <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-local-space" title="DTB">rif:local</a></tt> constants, and so on.
</p><p>Document formulas with and without annotations will be referred to as <i><b>RIF-FLD documents</b></i>.
</p><p>A convention is used to avoid a syntactic ambiguity in the above definition. For instance, in <tt>(* id φ *) t[w -> v]</tt> the annotation can be attributed to the term <tt>t</tt> or to the entire frame <tt>t[w -> v]</tt>. Similarly, for an annotated HiLog-like term of the form <tt>(* id φ *) f(a)(b,c)</tt>, the annotation can be attributed to the entire term <tt>f(a)(b,c)</tt> or to just <tt>f(a)</tt>. The convention adopted in RIF-FLD is that any annotation is syntactically associated with the largest RIF-FLD term or formula that appears to the right of that annotation. Therefore, in our examples the annotation <tt>(* id φ *)</tt> is considered to be attached to the entire frame <tt>t[w -> v]</tt> and to the entire term <tt>f(a)(b,c)</tt>.
Yet, since <tt>φ</tt> can be a conjunction, some conjuncts can be used to provide metadata targeted to the object part, <tt>t</tt>, of the frame. For instance, <tt>(* And(_foo[meta_for_frame->"this is an annotation for the entire frame"] _bar[meta_for_object->"this is an annotation for t" meta_for_property->"this is an annotation for w"] *) t[w -> v]</tt>. Generally, the convention associates each annotation to the largest term or formula it precedes.
</p><p>We suggest to use Dublin Core, RDFS, and OWL properties for metadata, along the lines of <a class="external text" href="http://www.w3.org/TR/owl-ref/#Annotations" title="http://www.w3.org/TR/owl-ref/#Annotations">Section 7.1</a> of [<a href="#ref-owl-reference" title="">OWL-Reference</a>]-- specifically <tt>owl:versionInfo</tt>, <tt>rdfs:label</tt>, <tt>rdfs:comment</tt>, <tt>rdfs:seeAlso</tt>, <tt>rdfs:isDefinedBy</tt>, <tt>dc:creator</tt>, <tt>dc:description</tt>, <tt>dc:date</tt>, and <tt>foaf:maker</tt>.
</p><p><br />
</p>
<p>
<b>Example 3</b> (A RIF-FLD document with nested groups and annotations).
</p>
<p>We illustrate formulas, including documents and groups, with the following complete example (with apologies to Shakespeare for the imperfect rendering of the intended meaning in logic). For better readability, we use the notation defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>], which provides shortcuts for writing IRIs. The first shortcut notation lets one write long <tt>rif:iri</tt> constants in the form <tt>prefix:name</tt>, where <tt>prefix</tt> is a short name that expands into an IRI according to a suitable <tt>Prefix</tt> directive. For instance, <tt>ex:man</tt> would expand into the <tt>rif:iri</tt> constant <tt>"http://example.org/ontology#man"^^rif:iri</tt>, if <tt>ex</tt> is defined as in the <tt>Prefix(ex ...)</tt> directive below. The second shortcut notation uses angle brackets as a way to shorten the <tt>"..."^^rif:iri</tt> idiom. For instance, the prevous <tt>rif:iri</tt> constant can be alternatively represented as <tt><http://example.org/ontology#man></tt>. The last shortcut notation lets one write <tt>rif:iri</tt> constants using IRIs relative to a base, where the base IRI is specified in a <tt>Base</tt> directive. For instance, with the <tt>Base</tt> directive, below, both <tt><Yorick></tt> and <tt>"Yorick"^^rif:iri</tt> expand into the <tt>rif:iri</tt> constant <tt>"http://www.shakespeare-literature.com/Hamlet/Yorick"^^rif:iri</tt>. The example also illustrates attachment of annotations.
</p>
<pre> Document(
Base(<http://www.shakespeare-literature.com/Hamlet/>)
Prefix(dc <http://<a class="external free" href="http://purl.org/dc/terms/" title="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>>)
Prefix(ex <http://example.org/ontology#>)
(* <assertions> <assertions>[dc:title->"Hamlet" dc:creator->"Shakespeare"] *)
Group(
Exists ?X (And(?X # ex:RottenThing
ex:partof(?X <http://www.denmark.dk>)))
Forall ?X (Or(<tobe>(?X) Naf <tobe>(?X)))
Forall ?X (And(Exists ?B (And(ex:has(?X ?B) ?B # ex:business))
Exists ?D (And(ex:has(?X ?D) ?D # ex:desire)))
:- ?X # ex:man)
(* <facts> *)
Group(
<Yorick> # ex:poor
<Hamlet> # ex:prince
)
)
)
</pre>
<p>The above RIF formulas are (admittedly awkward) logical renderings of the following statements from Shakespeare's Hamlet: "Something is rotten in the state of Denemark," "To be, or not to be," and "Every man has business and desire."
</p><p>Observe that the above set of formulas has a nested subset with its own
annotation, <tt><facts></tt>, which contains only a global IRI. ☐
</p><p>The following example illustrates the use of imported RIF documents and of remote terms.
</p>
<p>
<b>Example 4</b> (A RIF-FLD document with imports, remote module references, and aggregation).
</p>
<p>
The first document, below, imports the second document, which is assumed to be located at the IRI <tt>http://example.org/universityontology</tt>. In addition, the first document has references to two remote modules, which are located at <tt>http://example.org/university#1</tt> and <tt>http://example.org/university#2</tt>, respectively. These modules are assumed to be knowledge bases that provide the usual information about university enrollment, courses offered in different semesters, and so on.
The rules corresponding to the remote modules are not shown, as they do not illustrate new features. In the simplest case, these knowledge bases can simply be sets of facts for the predicates/frames that supply the requisite information.
</p>
<pre> Document(
Prefix(u <http://example.org/universityontology#>)
Prefix(pred <http://www.w3.org/2007/rif-builtin-predicate#>)
Import(<http://example.org/universityontology>)
Module(_univ(1) <http://example.org/university#1>)
Module(_univ(2) <http://example.org/university#2>)
Group(
Forall ?Stud ?Crs ?Semester ?U (u:takes(?Stud ?Crs ?Semester) :-
?Stud[u:takes(?Semester)->?Crs]@ _univ(?U))
Forall ?Prof ?Crs ?Semester ?U (u:teaches(?Prof ?Crs ?Semester) :-
u:teaches(?Prof ?Crs ?Semester)@ _univ(?U))
Forall ?Crs (u:popular_course(?Crs) :-
And(?Crs#u:Course
pred:numeric-less-than(500
count{?Stud[?Crs]|Exists ?Semester (u:takes(?Stud ?Crs ?Semester))})))
)
)
</pre>
<p><br />
The imported document, located at <tt>http://example.org/universityontology</tt>, has the following form:
</p>
<pre> Document(
Group(
Forall ?Stud ?Prof ?Sem
(u:studentOf(?Stud ?Prof) :-
And(u:takes(?Stud ?Crs ?Sem) u:teaches(?Prof ?Crs ?Sem)))
)
)
</pre>
<p>In this example, the main document contains three rules, which define the predicates <tt>u:takes</tt>, <tt>u:teaches</tt> and <tt>u:popular_course</tt>. The information for the first two predicates is obtained by querying the remote modules corresponding to Universities 1 and 2. The rule that defines the first predicate says that if the remote university knowledge base says that a student <tt>s</tt> takes a course <tt>c</tt> in a certain semester <tt>s</tt> then <tt>takes(s c s)</tt> is true in the main document. The second rule makes a similar statement about professors teaching courses in various semesters. Inside the main document, the external modules are refered to via the terms <tt>_univ(1)</tt> and <tt>_univ(2)</tt>. The <tt>Module</tt> directives tie these references to the actual locations. The underscore in front of <tt>univ</tt> signifies that this is a <tt>rif:local</tt> symbol and is a shortcut for <tt>"univ"^^rif:local</tt>, as defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>], Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-symbol-spaces" title="DTB">Constants and Symbol Spaces</a>. Note that the remote modules use frames to represent the enrollment information and predicates to represent course offerings. The rules in the main document convert both of these representations to predicates. The third rule illustrates a use of aggregation. The comprehension variable here is <tt>?Stud</tt> and <tt>?Crs</tt> is a grouping variable. Note that these are the only free variables in the formula over which aggregation is computed. For each course, the aggregate counts the number of students in that course over all semesters, and if the number exceeds 500 then the course is declared popular. Note also that the comprehension variable <tt>?Stud</tt> is bound by the aggregate, so it is not quantified in the <tt>Forall</tt>-prefix of the rule.
</p><p>The imported document has only one rule, which defines a new concept, <tt>u:studentOf</tt> (a student is a <tt>studentOf</tt> of a certain professor if that student takes a course from that professor). Since the main document imports the second document, it can answer queries about <tt>u:studentOf</tt> as if this concept were defined directly within the main document. ☐
</p><p><br />
<span class="anchor" id="sec-concrete-syntax"></span>
</p>
<a id="EBNF_Grammar_for_the_Presentation_Syntax_of_RIF-FLD" name="EBNF_Grammar_for_the_Presentation_Syntax_of_RIF-FLD"></a><h4> <span class="mw-headline">2.10 EBNF Grammar for the Presentation Syntax of RIF-FLD </span></h4>
<p>Until now, to specify the syntax of RIF-FLD we relied on "mathematical English," a special form of English for communicating mathematical definitions, examples, etc. We will now specify the syntax using the familiar EBNF notation. The following points about the EBNF notation should be kept in mind:
</p>
<ul><li> The syntax of RIF-FLD relies on the signature mechanism and is not context-free, so EBNF does not capture this syntax precisely. As a result, the EBNF grammar defines a strict <i>superset</i> of RIF-FLD (not all formulas that are derivable using the EBNF grammar are well-formed).
</li><li> The EBNF syntax is <i>not a concrete</i> syntax: it does not address the details of how constants (defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>]) and variables are represented, and it is not sufficiently precise about the delimiters and escape symbols. White space is informally used as a delimiter, and is implied in productions that use Kleene star. For instance, <tt>TERM*</tt> is to be understood as <tt>TERM TERM ... TERM</tt>, where each ' ' abstracts from one or more blanks, tabs, newlines, etc. This is done intentionally since RIF's presentation syntax is used as a tool for specifying the semantics and for illustration of the main RIF concepts through examples.
</li><li> RIF defines a concrete syntax only for exchanging rules, and that syntax is XML-based, obtained as a refinement and serialization of the EBNF syntax via the <a href="#sec-translate-fld-to-xml" title="">presentation-syntax-to-XML mapping for RIF-FLD</a>.
</li></ul>
<p>Keeping the above in mind, the EBNF grammar can be seen as just an intermediary between the mathematical English and the XML. However, it also gives a succinct view of the syntax of RIF-FLD and as such can be useful for dialect designers and users alike.
</p><p><br />
</p>
<pre> Document ::= IRIMETA? 'Document' '(' Dialect? Base? Prefix* Import* Module* Group? ')'
Dialect ::= 'Dialect' '(' Name ')'
Base ::= 'Base' '(' <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">ANGLEBRACKIRI</a> ')'
Prefix ::= 'Prefix' '(' <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a> <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">ANGLEBRACKIRI</a> ')'
Import ::= IRIMETA? 'Import' '(' LOCATOR PROFILE? ')'
Module ::= IRIMETA? 'Module' '(' (Const | Expr) LOCATOR ')'
Group ::= IRIMETA? 'Group' '(' (FORMULA | Group)* ')'
Implies ::= IRIMETA? FORMULA ':-' FORMULA
FORMULA ::= Implies |
IRIMETA? CONNECTIVE '(' FORMULA* ')' |
IRIMETA? QUANTIFIER '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? FORMULA '@' MODULEREF |
FORM
PROFILE ::= <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">ANGLEBRACKIRI</a>
FORM ::= IRIMETA? (Var | ATOMIC |
'External' '(' ATOMIC LOCATOR? ')')
ATOMIC ::= Const | Atom | Equal | Member | Subclass | Frame
Atom ::= UNITERM
UNITERM ::= TERMULA '(' (TERMULA* | (Name '->' TERMULA)*) ')'
Equal ::= TERMULA '=' TERMULA
Member ::= TERMULA '#' TERMULA
Subclass ::= TERMULA '##' TERMULA
Frame ::= TERMULA '[' (TERMULA '->' TERMULA)* ']'
TERMULA ::= Implies |
IRIMETA? CONNECTIVE '(' TERMULA* ')' |
IRIMETA? QUANTIFIER '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? TERMULA '@' MODULEREF |
TERM
TERM ::= IRIMETA? (Var | EXPRIC | List |
'External' '(' EXPRIC LOCATOR? ')' |
AGGREGATE | NEWTERM)
EXPRIC ::= Const | Expr | Equal | Member | Subclass | Frame
Expr ::= UNITERM
List ::= 'List' '(' TERM* ')' | 'List' '(' TERM+ '|' TERM ')'
AGGREGATE ::= AGGRFUNC '{' Var ('[' Var+ ']')? '|' FORMULA '}'
Const ::= '"' <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">UNICODESTRING</a> '"^^' SYMSPACE | <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">CONSTSHORT</a>
MODULEREF ::= Var | Const | Expr
CONNECTIVE ::= 'And' | 'Or' | NEWCONNECTIVE
QUANTIFIER ::= ('Exists' | 'Forall' | NEWQUANTIFIER) Var*
AGGRFUNC ::= 'Min' | 'Max' | 'Sum' | 'Prod' | 'Avg' | 'Count' |
'Set' | 'Bag' | NEWAGGRFUNC
Var ::= '?' Name
Name ::= <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCName</a> | '"' <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">UNICODESTRING</a> '"'
SYMSPACE ::= <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">ANGLEBRACKIRI</a> | <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">CURIE</a>
IRIMETA ::= '(*' Const? (Frame | 'And' '(' Frame* ')')? '*)'
</pre>
<p>The RIF-FLD presentation syntax does not commit to any particular vocabulary and permits arbitrary sequences of Unicode characters in constant symbols, argument names, and variables. Such sequences are denoted with <tt>UNICODESTRING</tt> in the above syntax. Constant symbols have this form: <tt>"UNICODESTRING"^^SYMSPACE</tt>, where <tt>SYMSPACE</tt> is a <tt>ANGLEBRACKIRI</tt> or <tt>CURIE</tt> that represents the identifier of the symbol space of the constant. <tt>UNICODESTRING</tt>, <tt>ANGLEBRACKIRI</tt>, and <tt>CURIE</tt> are defined in Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-shortcuts-constants" title="DTB">Shortcuts for Constants in RIF's Presentation Syntax</a> of [<a href="#ref-rif-dtb" title="">RIF-DTB</a>]. Constant symbols can also have several shortcut forms, which are represented by the non-terminal <tt>CONSTSHORT</tt>. These shortcuts are also defined in the same section of [<a href="#ref-rif-dtb" title="">RIF-DTB</a>]. One of them is the <tt>CURIE</tt> shortcut, which is used in the examples in this document.
Names are Unicode character sequences that form valid XML <a class="external text" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816/#NT-NCName">NCNames</a> [<a href="#ref-xml-names" title="">XML-Names</a>]. Variables are composed of Names prefixed with a <tt>?</tt>-sign.
</p><p><tt>LOCATOR</tt>, which is used in several places in the grammar, is a non-terminal whose definition is left to the dialects. It is intended to specify the protocol by which external sources, remote modules, and imported RIF documents are located. This must include the basic form <tt><IRI></tt>, where <tt>IRI</tt> is a Unicode string in the form of an absolute IRI.
</p><p>The symbols <a href="#ref-newconective" title=""><tt>NEWCONNECTIVE</tt></a>, <a href="#ref-newquantifier" title=""><tt>NEWQUANTIFIER</tt></a>, <a href="#ref-newaggrfunc" title=""><tt>NEWAGGRFUNC</tt></a>, and <a href="#ref-newterm" title=""><tt>NEWTERM</tt></a> are RIF-FLD <a href="#ref-extension-point" title="">extension points</a>. They are not actual symbols in the alphabet. Instead, dialects are supposed to replace <tt>NEWCONNECTIVE</tt>, <tt>NEWQUANTIFIER</tt>, and <tt>NEWAGGRFUNC</tt>, by zero or more actual new symbols, while <tt>NEWTERM</tt> is to be replaced by zero or more new kinds of terms.
Note that the extension point <a href="#ref-newsymbol" title=""><tt>NEWSYMBOL</tt></a> is not shown in the EBNF grammar, since the grammar completely avoids mentioning the alphabet of the language (which is infinite).
</p><p><br />
Each RIF-FLD formula and term can be prefixed with one optional annotation, <tt>IRIMETA</tt>, for identification and metadata. <tt>IRIMETA</tt> is represented using <tt>(*...*)</tt>-brackets that contain an optional <tt>rif:iri</tt> constant as identifier followed by an optional <tt>Frame</tt> or conjunction of <tt>Frame</tt>s as metadata. One such specialization is <tt>'"' IRI '"^^' 'rif:iri'</tt> from the <tt>Const</tt> production, where <tt>IRI</tt> is a sequence of Unicode characters that forms an internationalized resource identifier as defined by [<a href="#ref-rfc-3987" title="">RFC-3987</a>].
</p><p>Note that the RIF-FLD presentation syntax (as reflected in the above EBNF grammar) strives to have a more familiar look by avoiding some of the formal parts of the syntax defined in Sections <a href="#sec-alphabet" title="">Alphabet</a> and <a href="#sec-terms" title="">Terms</a>. For instance, as mentioned in those sections, the quantifier symbols <tt>Exists<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> and <tt>Forall<sub>?X<sub>1</sub>,...,?X<sub>n</sub></sub></tt> are linearized as <tt>Exists ?X<sub>1</sub>,...,?X<sub>n</sub></tt> and <tt>Forall ?X<sub>1</sub>,...,?X<sub>n</sub></tt>. Likewise, the symbol <tt>OpenList</tt> is not used. Instead, open lists are written using the more familiar form <tt>LIST(Head|Tail)</tt>. Also, some connectives, such as <tt>:-</tt>, are written in infix form. Other connectives, such as <tt>Neg</tt> and <tt> Naf</tt>, are written in prefix form without parentheses.
</p><p><br />
<span class="anchor" id="sec-fld-semantic-framework"></span>
</p>
<a id="Semantic_Framework" name="Semantic_Framework"></a><h2> <span class="mw-headline">3 Semantic Framework </span></h2>
<p>Recall that the presentation syntax of RIF-FLD allows the use of shorthand notation, which is specified via the <tt>Prefix</tt> and <tt>Base</tt> directives, and various shortcuts for integers, strings, and <tt>rif:local</tt> symbols.
The semantics, below, is described using the full syntax, i.e., we
assume that all shortcuts have already been expanded, as defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>], Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-symbol-spaces" title="DTB">Constants and Symbol Spaces</a>.
</p><p><span class="anchor" id="sec-rif-dialect-semantics"></span>
</p>
<a id="Semantics_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD" name="Semantics_of_a_RIF_Dialect_as_a_Specialization_of_RIF-FLD"></a><h4> <span class="mw-headline">3.1 Semantics of a RIF Dialect as a Specialization of RIF-FLD </span></h4>
<p>The RIF-FLD semantic framework defines the notions of <i>semantic structures</i> and of <i>models</i> for RIF-FLD formulas. The <i><b>semantics of a dialect</b></i> is derived from these notions by specializing the following parameters.
</p>
<ol>
<li>The <i>effect of the syntax</i>.
<ul>
<li>
The syntax of a dialect may limit the kinds of terms that are allowed.
<p>
For instance, if a dialect's syntax excludes frames or terms with named arguments then the parts of the <a href="#sec-model-theory" title="">semantic structures</a> whose purpose is to interpret those types of terms (<tt><i><b>I</b></i><sub>frame</sub></tt> and <tt><i><b>I</b></i><sub>NF</sub></tt> in this case) become redundant.
</p>
</li>
<li>
The dialect might introduce additonal terms and their interpretation by semantic structures.
</li>
<li>
The dialect might introduce additional connectives and quantifiers with their interpretation.
</li>
</ul>
</li>
<li><i>Truth values</i>.
<p>
The RIF-FLD semantic framework allows formulas to have truth values from an arbitrary partially ordered set of truth values, <i><b>TV</b></i>. A concrete dialect must select a concrete partially or totally ordered set of truth values.
</p>
</li>
<li><i>Datatypes</i>.
<p>A datatype is a symbol space whose symbols have a fixed interpretation in any semantic structure. RIF-FLD defines a set of core datatypes that each dialect is required to include as part of its syntax and semantics. However, RIF-FLD does not limit dialects to just the core types: they can introduce additional datatypes, and each dialect must define the exact set of datatypes that it includes.
</p>
</li>
<li> <i>Directives, connectives, extension points</i>.
<p>
Specialization of the definitions of RIF-BLD directives and logical connectives. Semantics of the syntactic components corresponding to the RIF-FLD extension points.
</p>
</li>
<li><i>Logical entailment</i>.
<p>
Logical entailment in RIF-FLD is defined with respect to an unspecified set of <i>intended</i> semantic structures (sometimes also known as <i>preferred</i> semantic structures). This notion of entailment is very general and is known to subsume most of the known logical semantics for rule-based systems.
</p>
<p>
A RIF dialect must define which semantic structures should considered intended. The actual choice depends on the desired semantics and is typically done by a trained logician. Many "off-the-shelf" semantics -- each suitable for different purposes -- have been defined in the literature.
For instance, one dialect might specify that all semantic structures are intended (which leads to classical first-order entailment), another may consider only the minimal models as intended structures, while a third dialect might only use <i>stable</i> or <i>well-founded</i> models [<a href="#ref-wf-model" title="">GRS91</a>, <a href="#ref-stable-model" title="">GL88</a>].
</p>
</li>
</ol>
<p>
These notions are defined in the remainder of this specification.
</p>
<p><br />
<span class="anchor" id="sec-truth-values"></span>
</p>
<a id="Truth_Values" name="Truth_Values"></a><h4> <span class="mw-headline">3.2 Truth Values </span></h4>
<p><span class="anchor" id="def-fld-truth-value"></span>
<b>Definition (Set of truth values).</b>
Each RIF dialect must define the set of <i><b>truth values</b></i>, denoted by <i><b>TV</b></i>. This set must have a partial order, called the <i><b>truth order</b></i>, denoted <<sub>t</sub>. In some dialects, <<sub>t</sub> can be a total order. We write <i>a</i> ≤<sub>t</sub> <i>b</i> if either <i>a</i> <<sub>t</sub> <i>b</i> or <i>a</i> and <i>b</i> are the same element of <i><b>TV</b></i>. In addition,
</p>
<ul><li> <i><b>TV</b></i> must be a complete lattice with respect to <<sub>t</sub>, i.e., the least upper bound (lub<sub>t</sub>) and the greatest lower bound (glb<sub>t</sub>) must exist for any subset of <i><b>TV</b></i>.
</li><li> <i><b>TV</b></i> is required to have two distinguished elements, <b>f</b> and <b>t</b>, such that <b>f</b> ≤<sub>t</sub> <i>elt</i> and <i>elt</i> ≤<sub>t</sub> <b>t</b> for every <i>elt</i>∈<i><b>TV</b></i>.
</li><li> <i><b>TV</b></i> has an <i><b>operator of negation</b></i>, <tt>~</tt>: <i><b>TV</b></i> → <i><b>TV</b></i>, such that
<ul><li> <tt>~</tt> is a self-inverse function: applying <tt>~</tt> twice gives the identity mapping.
</li><li> <tt>~</tt><b>t</b> = <b>f</b> (and thus <tt>~</tt><b>f</b> = <b>t</b>). ☐
</li></ul>
</li></ul>
<p>RIF dialects can have additional truth values. For instance, the semantics of some versions of NAF, such as <i>well-founded negation</i>, requires three truth values: <b>t</b>, <b>f</b>, and <b>u</b> (undefined), where <b>f</b> <<sub>t</sub> <b>u</b> <<sub>t</sub> <b>t</b>. Handling of contradictions and uncertainty usually requires at least four truth values: <b>t</b>, <b>u</b>, <b>f</b>, and <b>i</b> (inconsistent). In this case, the truth order is partial: <b>f</b> <<sub>t</sub> <b>u</b> <<sub>t</sub> <b>t</b> and <b>f</b> <<sub>t</sub> <b>i</b> <<sub>t</sub> <b>t</b>. The negation operator <tt>~</tt> is then defined to be the identity on the new truth values <b>u</b> and <b>i</b>.
</p><p><br />
<span class="anchor" id="sec-data-types"></span>
</p>
<a id="Datatypes" name="Datatypes"></a><h4> <span class="mw-headline">3.3 Datatypes </span></h4>
<p><span class="anchor" id="def-fld-datatype"></span>
<b>Definition (Datatype).</b>
A <i><b>datatype</b></i> is a symbol space that has
</p>
<ul><li> an associated set, called the <i><b>value space</b></i>, and
</li><li> a mapping from the lexical space of the symbol space to the value space, called <i><b>lexical-to-value-space mapping</b></i>. ☐
</li></ul>
<p>Semantic structures are always defined with respect to a particular set of datatypes, denoted by <i><b>DTS</b></i>. In a concrete dialect, <i><b>DTS</b></i> always includes the datatypes supported by that dialect. All RIF dialects must support the datatypes that are listed in Section <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#sec-data-types" title="DTB">Datatypes</a> of [<a href="#ref-rif-dtb" title="">RIF-DTB</a>].
Their value spaces and the lexical-to-value-space mappings for these datatypes are described in the same section.
</p><p><br />
Although the lexical and the value spaces might sometimes look similar, one should not confuse them. Lexical spaces define the syntax of the constant symbols in the RIF language. Value spaces define the <i>meaning</i> of the constants. The lexical and the value spaces are often not even isomorphic. For example, <tt>1.2^^xs:decimal</tt> and <tt>1.20^^xs:decimal</tt> are two legal -- and distinct -- constants in RIF because <tt>1.2</tt> and <tt>1.20</tt> belong to the lexical space of <tt>xs:decimal</tt>. However, these two constants are interpreted by the <i>same</i> element of the value space of the <tt>xs:decimal</tt> type. Therefore, <tt>1.2^^xs:decimal = 1.20^^xs:decimal</tt> is a RIF tautology. Likewise, RIF semantics for datatypes implies certain inequalities. For instance, <tt>abc^^xs:string</tt> ≠ <tt>abcd^^xs:string</tt> is a tautology, since the lexical-to-value-space mapping of the <tt>xs:string</tt> type maps these two constants into distinct elements in the value space of <tt>xs:string</tt>.
</p><p><br />
<span class="anchor" id="sec-model-theory"></span>
</p>
<a id="Semantic_Structures" name="Semantic_Structures"></a><h4> <span class="mw-headline">3.4 Semantic Structures </span></h4>
<p>The central step in specifying a model-theoretic semantics for a logic-based language is defining the notion of a <i>semantic structure</i>. Semantic structures are used to assign truth values to <a href="#sec-fld-wff" title="">RIF-FLD formulas</a>.
</p><p><span class="anchor" id="def-fld-sem-struct"></span>
<b>Definition (Semantic structure).</b>
A <i><b>semantic structure</b></i>, <i><b>I</b></i>, is a tuple of the form <<i><b>TV</b></i>, <i><b>DTS</b></i>, <i><b>D</b></i>, <i><b>I</b></i><sub>C</sub>, <i><b>I</b></i><sub>V</sub>, <i><b>I</b></i><sub>F</sub>, <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>list</sub>, <i><b>I</b></i><sub>tail</sub>, <i><b>I</b></i><sub>frame</sub>, <i><b>I</b></i><sub>sub</sub>, <i><b>I</b></i><sub>isa</sub>, <i><b>I</b></i><sub>=</sub>, <i><b>I</b></i><sub>external</sub>, <i><b>I</b></i><sub>connective</sub>, <i><b>I</b></i><sub>truth</sub>>. Here <i><b>D</b></i> is a non-empty set of elements called the <i><b>domain</b></i> of <i><b>I</b></i>. We will continue to use <tt>Const</tt> to refer to the set of all constant symbols and <tt>Var</tt> to refer to the set of all variable symbols. <i><b>TV</b></i> denotes the set of truth values that the semantic structure uses and <i><b>DTS</b></i> is a set of identifiers for datatypes.
</p><p>The other components of <i><b>I</b></i> are <i>total</i> mappings defined as follows:
</p>
<ol>
<li><i><b>I</b></i><sub>C</sub> maps <tt>Const</tt> to elements of <i><b>D</b></i>.
<p>This mapping interprets constant symbols. </p>
</li>
<li><i><b>I</b></i><sub>V</sub> maps <tt>Var</tt> to elements of <i><b>D</b></i>.
<p>This mapping interprets variable symbols. </p>
</li>
<li><i><b>I</b></i><sub>F</sub> maps <i><b>D</b></i> to total functions <i><b>D*</b></i> → <i><b>D</b></i> (here <i><b>D*</b></i> is a set of all finite sequences over the domain <i><b>D</b></i>).
<p>This mapping interprets positional terms. </p>
</li>
<li><i><b>I</b></i><sub>NF</sub> interprets terms with named arguments. It is a total mapping from <i><b>D</b></i> to the set of total functions of the form <tt>SetOfFiniteBags</tt>(<tt>ArgNames</tt> × <i><b>D</b></i>) → <i><b>D</b></i>.
<p>
This is analogous to the interpretation of positional terms with two differences:
</p>
<ul>
<li>Each pair <<tt>s,v</tt>> ∈ <tt>ArgNames</tt> × <i><b>D</b></i> represents an argument/value pair instead of just a value in the case of a positional term.
</li>
<li>The argument to a term with named arguments is a finite bag of argument/value pairs rather than a finite ordered sequence of simple elements.
</li>
<li>Bags are used here because the order of the argument/value pairs in a term with named arguments is immaterial and the pairs may repeat: <tt>p(a->b a->b)</tt>. (However, <tt>p(a->b a->b)</tt> is not equivalent to <tt>p(a->b)</tt>, as we shall see later.)
<p>
To see why such repetition can occur, note that argument names may repeat: <tt>p(a->b a->c)</tt>. This can be understood as treating <tt>a</tt> as a bag-valued argument. Identical argument/value pairs can then arise as a result of a substitution. For instance, <tt>p(a->?A a->?B)</tt> becomes <tt>p(a->b a->b)</tt> if the variables <tt>?A</tt> and <tt>?B</tt> are both instantiated with the symbol <tt>b</tt>.
</p>
</li>
</ul>
</li>
<li>
<i><b>I</b></i><sub>list</sub> and <i><b>I</b></i><sub>tail</sub> are used to interpret lists. They are mappings of the following form:
<ul>
<li>
<i><b>I</b></i><sub>list</sub> : <i><b>D</b></i><sup>*</sup> → <i><b>D</b></i>
</li>
<li>
<i><b>I</b></i><sub>tail</sub> : <i><b>D</b></i><sup>+</sup>×<i><b>D</b></i> → <i><b>D</b></i>
</li>
</ul>
<p>
In addition, these mappings are required to satisfy the following conditions:
</p>
<ul>
<li>
The function <i><b>I</b></i><sub>list</sub> is injective (one-to-one).
</li>
<li>
The set <i><b>I</b></i><sub>list</sub>(<i><b>D</b></i><sup>*</sup>), henceforth denoted <span class="anchor" id="def-Dlist"><i><b>D</b></i><sub>list</sub></span>, is disjoint from the value spaces of all data types in <i><b>DTS</b></i>.
</li>
<li>
<i><b>I</b></i><sub>tail</sub>(<tt>a</tt><sub>1</sub>, ..., <tt>a</tt><sub>k</sub>, <i><b>I</b></i><sub>list</sub>(<tt>a</tt><sub>k+1</sub>, ..., <tt>a</tt><sub>k+m</sub>)) = <i><b>I</b></i><sub>list</sub>(<tt>a</tt><sub>1</sub>, ..., <tt>a</tt><sub>k</sub>, <tt>a</tt><sub>k+1</sub>, ..., <tt>a</tt><sub>k+m</sub>).
</li>
</ul>
<p>
Note that the last condition above restricts <i><b>I</b></i><sub>tail</sub> only when its last argument is in <i><b>D</b></i><sub>list</sub>. If the last argument of <i><b>I</b></i><sub>tail</sub> is not in <i><b>D</b></i><sub>list</sub>, then the list is a general open one and there are no restrictions on the value of <i><b>I</b></i><sub>tail</sub> except that it must be in <i><b>D</b></i>.
</p>
</li>
<li><i><b>I</b></i><sub>frame</sub> is a total mapping from <i><b>D</b></i> to total functions of the form <tt>SetOfFiniteBags</tt>(<i><b>D</b></i> × <i><b>D</b></i>) → <i><b>D</b></i>.
<p>
This mapping interprets frame terms. An argument, <tt>d</tt> ∈ <i><b>D</b></i>, to <i><b>I</b></i><sub>frame</sub> represents an object and a finite bag {<<tt>a1,v1</tt>>, ..., <<tt>ak,vk</tt>>} represents a bag (multiset) of attribute-value pairs for <tt>d</tt>. We will see shortly how <i><b>I</b></i><sub>frame</sub> is used to determine the truth valuation of frame terms.
</p>
<p>
Bags are employed here because the order of the attribute/value pairs in a frame is immaterial and the pairs may repeat. For instance, <tt>o[a->b a->b]</tt>. Such repetitions arise naturally when variables are instantiated with constants. For instance, <tt>o[?A->?B ?C->?D]</tt> becomes <tt>o[a->b a->b]</tt> if variables <tt>?A</tt> and <tt>?C</tt> are instantiated with the symbol <tt>a</tt> and <tt>?B</tt>, <tt>?D</tt> with <tt>b</tt>. (We shall see later that <tt>o[a->b a->b]</tt> is equivalent to <tt>o[a->b]</tt>.)
</p>
</li>
<li><i><b>I</b></i><sub>sub</sub> gives meaning to the subclass relationship. It is a total function <i><b>D</b></i> × <i><b>D</b></i> → <i><b>D</b></i>.
<p>The operator <tt>##</tt> is required to be transitive, i.e., <tt>c1 ## c2</tt> and <tt>c2 ## c3</tt> must imply <tt>c1 ## c3</tt>. This is ensured by a restriction in Section <a href="#sec-interpretation-of-formulas" title="">Interpretation of Formulas</a>.
</p>
</li>
<li><i><b>I</b></i><sub>isa</sub> gives meaning to class membership. It is a total function <i><b>D</b></i> × <i><b>D</b></i> → <i><b>D</b></i>.
<p>The relationships <tt>#</tt> and <tt>##</tt> are required to have the usual property that all members of a subclass are also members of the superclass, i.e., <tt>o # cl</tt> and <tt>cl ## scl</tt> must imply <tt>o # scl</tt>. This is ensured by a restriction in Section <a href="#sec-interpretation-of-formulas" title="">Interpretation of Formulas</a>.
</p>
</li>
<li><i><b>I</b></i><sub>=</sub> is a total function <i><b>D</b></i> × <i><b>D</b></i> → <i><b>D</b></i>.
<p>It gives meaning to the equality operator.</p>
</li>
<li>
<i><b>I</b></i><sub>truth</sub> is a total mapping <i><b>D</b></i> → <i><b>TV</b></i>.
<p>It is used to define truth valuation for formulas.</p>
</li>
<li>
<i><b>I</b></i><sub>external</sub> is a mapping from the coherent set of schemas for externally defined terms to total functions <i><b>D</b></i>* → <i><b>D</b></i>. For each external schema <tt>σ = (?X<sub>1</sub> ... ?X<sub>n</sub>; τ; loc)</tt> in the <a href="#sec-fld-language" title="">coherent set of such schemas associated with the language</a>, <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) is a function of the form <i><b>D</b></i><sup>n</sup> → <i><b>D</b></i>.
<p>
For every external schema, <tt>σ</tt>, associated with the language, <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) is assumed to be specified externally in some document (hence the name <i>external schema</i>). In particular, if <tt>σ</tt> is a schema of a RIF built-in predicate or function, <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) is specified in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>] so that:
</p>
<ul>
<li>
If <tt>σ</tt> is a schema of a built-in function then <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>) must be the function defined in the aforesaid document.
</li>
<li>
If <tt>σ</tt> is a schema of a built-in predicate then
<i><b>I</b></i><sub>truth</sub><tt> ο </tt>(<i><b>I</b></i><sub>external</sub>(<tt>σ</tt>)) (the composition of <i><b>I</b></i><sub>truth</sub> and <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>), a truth-valued function) must be as specified in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>].
</li>
</ul>
</li>
<li>
<i><b>I</b></i><sub>connective</sub> is a mapping that assigns every connective, quantifier, or aggregate symbol a function <i><b>D*</b></i> → <i><b>D</b></i>.
<p>
Further restrictions on the interaction of this function with <i><b>I</b></i><sub>truth</sub> will be imposed in order to ensure the intended semantics for each connective and quantifier.
For aggregates, <i><b>I</b></i><sub>connective</sub> maps them to functions <i><b>D</b></i> → <i><b>D</b></i> and additional restrictions are imposed on the mapping <i><b>I</b></i> defined below.
</p>
</li>
</ol>
<p>We also define the following <span class="anchor" id="def-term-interpreting-map"><i><b>term-interpreting mapping</b></i></span> on well-formed terms, which we denote using the same symbol <i><b>I</b></i> that is used for the semantic structure itself. This overloading is convenient and does not lead to ambiguity.
</p>
<ol>
<li>
<i><b>I</b></i>(<tt>k</tt>) = <i><b>I</b></i><sub>C</sub>(<tt>k</tt>), if <tt>k</tt> is a symbol in <tt>Const</tt>
</li>
<li>
<i><b>I</b></i>(<tt>?v</tt>) = <i><b>I</b></i><sub>V</sub>(<tt>?v</tt>), if <tt>?v</tt> is a variable in <tt>Var</tt>
</li>
<li>
<i><b>I</b></i>(<tt>f(t<sub>1</sub> ... t<sub>n</sub>)</tt>) = <i><b>I</b></i><sub>F</sub>(<i><b>I</b></i>(<tt>f</tt>))(<i><b>I</b></i>(<tt>t<sub>1</sub></tt>),...,<i><b>I</b></i>(<tt>t<sub>n</sub></tt>))
</li>
<li>
<i><b>I</b></i>(<tt>f(s<sub>1</sub>->v<sub>1</sub> ... s<sub>n</sub>->v<sub>n</sub>)</tt>) = <i><b>I</b></i><sub>NF</sub>(<i><b>I</b></i>(<tt>f</tt>))({<<tt>s<sub>1</sub></tt>,<i><b>I</b></i>(<tt>v<sub>1</sub></tt>)>,...,<<tt>s<sub>n</sub></tt>,<i><b>I</b></i>(<tt>v<sub>n</sub></tt>)>})
<p>Here we use {...} to denote a bag of argument/value pairs. </p>
</li>
<li>
For list terms, the mapping is defined as follows:
<ul>
<li>
<i><b>I</b></i>(<tt>List()</tt>) = <i><b>I</b></i><sub>list</sub>(<tt><></tt>).
<p>
Here <tt><></tt> denotes an empty list of elements of <i><b>D</b></i>. (Note that the domain of <i><b>I</b></i><sub>list</sub> is <i><b>D</b></i><sup>*</sup>, so <i><b>D</b></i><sup>0</sup> is an empty list of elements of <i><b>D</b></i>.)
</p>
</li>
<li>
<i><b>I</b></i>(<tt>List(t<sub>1</sub> ... t<sub>n</sub>)</tt>) = <i><b>I</b></i><sub>list</sub>(<i><b>I</b></i>(<tt>t<sub>1</sub></tt>), ..., <i><b>I</b></i>(<tt>t<sub>n</sub>)</tt>), if <tt>n>0</tt>.
</li>
<li>
<i><b>I</b></i>(<tt>List(t<sub>1</sub> ... t<sub>n</sub> | t</tt>)) = <i><b>I</b></i><sub>tail</sub>(<i><b>I</b></i>(<tt>t<sub>1</sub></tt>), ..., <i><b>I</b></i>(<tt>t<sub>n</sub></tt>), <i><b>I</b></i>(<tt>t</tt>)), if <tt>n>0</tt>.
</li>
</ul>
</li>
<li>
<i><b>I</b></i>(<tt>o[a<sub>1</sub>->v<sub>1</sub> ... a<sub>n</sub>->v<sub>n</sub>]</tt>) = <i><b>I</b></i><sub>frame</sub>(<i><b>I</b></i>(<tt>o</tt>))({<<i><b>I</b></i>(<tt>a<sub>1</sub></tt>),<i><b>I</b></i>(<tt>v<sub>1</sub></tt>)>, ..., <<i><b>I</b></i>(<tt>a<sub>n</sub></tt>),<i><b>I</b></i>(<tt>v<sub>n</sub></tt>)>})
<p>Here {...} denotes a bag of attribute/value pairs. Jumping ahead, we note that duplicate elements in such a bag do not affect the meaning of a frame formula. So, for instance, <tt>o[a->b a->b]</tt> and <tt>o[a->b]</tt> always have the same truth value.</p>
</li>
<li><i><b>I</b></i>(<tt>c1##c2</tt>) = <i><b>I</b></i><sub>sub</sub>(<i><b>I</b></i>(<tt>c1</tt>), <i><b>I</b></i>(<tt>c2</tt>))
</li>
<li><i><b>I</b></i>(<tt>o#c</tt>) = <i><b>I</b></i><sub>isa</sub>(<i><b>I</b></i>(<tt>o</tt>), <i><b>I</b></i>(<tt>c</tt>))
</li>
<li>
<i><b>I</b></i>(<tt>x=y</tt>) = <i><b>I</b></i><sub>=</sub>(<i><b>I</b></i>(<tt>x</tt>), <i><b>I</b></i>(<tt>y</tt>))
</li>
<li>
<i><b>I</b></i>(<tt>External(t loc)</tt>) = <i><b>I</b></i><sub>external</sub>(<tt>σ</tt>)(<i><b>I</b></i>(<tt>s<sub>1</sub></tt>), ..., <i><b>I</b></i>(<tt>s<sub>n</sub></tt>)), if <tt>External(t loc)</tt> is an instantiation of the external schema <tt>σ = (?X<sub>1</sub> ... ?X<sub>n</sub>; τ; loc)</tt> by substitution <tt>?X<sub>1</sub>/s<sub>1</sub> ... ?X<sub>n</sub>/s<sub>n</sub></tt>.
<p>
Note that, by definition, <tt>External(t loc)</tt> is well-formed only if it is an instantiation of an external schema. Furthermore, by the <a href="#def-fld-external-schema-set" title="">definition of coherent sets of external schemas</a>, it can be an instantiation of at most one such schema, so <i><b>I</b></i>(<tt>External(t loc)</tt>) is well-defined.
</p>
</li>
<li>
If <tt>S</tt> is a connective, a quantifier, or an aggregate and <tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt> is a well-formed formula term (for an aggregate, <tt>n=1</tt>) then
<p>
<i><b>I</b></i>(<tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt>) =
<i><b>I</b></i><sub>connective</sub>(<tt>S</tt>)(<i><b>I</b></i>(<tt>t<sub>1</sub></tt>) ... <i><b>I</b></i>(<tt>t<sub>n</sub></tt>))
</p>
</li>
<li>For standard aggregates, the mapping <i><b>I</b></i> is defined as follows.
<p>
Let <em>aggr</em>{<tt>?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ</tt>} be an aggregate and let <i>S</i> be the following set:
</p>
<p>
<i>S</i> = {(<i><b>I</b></i><sub>V</sub><sup>*</sup>(<tt>?X</tt>),<i><b>I</b></i><sub>V</sub><sup>*</sup>(<tt>?X<sub>1</sub></tt>), ..., <i><b>I</b></i><sub>V</sub><sup>*</sup>(<tt>?X<sub>n</sub></tt>)) | for all semantic structures <i><b>I</b></i><sup>*</sup> such that <i><b>I</b></i><sup>*</sup>(<tt>τ</tt>) = <b>t</b> and <i><b>I</b></i><sup>*</sup> is exactly like <i><b>I</b></i> except that <i><b>I</b></i><sub>V</sub><sup>*</sup>(<tt>?X</tt>) can be different from <i><b>I</b></i><sub>V</sub>(<tt>?X</tt>)}.
</p>
<p>
In addition, let <span style="text-decoration: overline"><i>S</i></span><sub>set</sub> denote the <em>set</em> of all elements x such that (x,x<sub>1</sub>, ..., x<sub>n</sub>) ∈ <i>S</i> and <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> denote the <em>bag</em> of all such elements x (i.e., <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> can have repeated occurrences of the same element).
</p>
<ol style="list-style-type:lower-alpha">
<li><i>Set aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>setof{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <i><b>I</b></i><sub>list</sub>(<tt>L</tt>)
<p>
where <tt>L</tt> is a sorted list of the elements in <span style="text-decoration: overline"><i>S</i></span><sub>set</sub>. Since sorting requires an ordering, the above is well-defined only for semantic structures with totally ordered domains. If <tt>L</tt> is infinite then the value of the aggregate in <i><b>I</b></i> is indeterminate (i.e., it can be any element of the domain <i><b>D</b></i>).
</p>
<p>
The requirement that the list <tt>L</tt> must be sorted comes from the fact that there can be many ways to represent <span style="text-decoration: overline"><i>S</i></span><sub>set</sub> as a list, while <i><b>I</b></i>(<tt>setof{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) must be defined as one concrete element of the domain <i><b>D</b></i>. Sorting a set is a standard way of providing the requisite unique representation.
</p>
</li>
</ul>
</li>
<li><i>Bag aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>bagof{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <i><b>I</b></i><sub>list</sub>(<tt>L</tt>)
<p>
where <tt>L</tt> is a sorted list of the elements in <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>. This is well-defined only for semantic structures with totally ordered domains. If <tt>L</tt> is infinite then the value of the aggregate in <i><b>I</b></i> is indeterminate (i.e., it can be any element of the domain <i><b>D</b></i>).
</p>
<p>
The reason for sorting <tt>L</tt> is the same as in the case of the set aggregate.
</p>
</li>
</ul>
</li>
<li><i>Min aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>min{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>min</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>min</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate.
The bag <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> must have a well-defined total order and <tt>min</tt> must compute the minimum elements of finite totally ordered bags.
</li>
</ul>
</li>
<li><i>Max aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>max{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>max</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>max</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate.
The bag <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> must have a well-defined total order and <tt>max</tt> must compute the maximum elements of finite totally ordered bags.
</li>
</ul>
</li>
<li><i>Count aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>count{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>count</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>count</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate. The function <tt>count</tt> must compute the cardinality of finite bags.
</li>
</ul>
</li>
<li><i>Sum aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>sum{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>sum</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>sum</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate. The function <tt>sum</tt> must compute summations of the elements of finite bags. (For decimals, integers, floats, etc., summation must coincide with the usual notion. However, this function might also be defined for other domains in some dialects.)
</li>
</ul>
</li>
<li><i>Prod aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>prod{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>prod</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>prod</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate. The function <tt>prod</tt> must compute products of the elements of finite bags. (For decimals, integers, floats, etc., product must coincide with the usual notion. However, this function might also be defined for other domains.)
</li>
</ul>
</li>
<li><i>Avg aggregate</i>:
<ul>
<li>
<i><b>I</b></i>(<tt>avg{?X [?X<sub>1</sub> ... ?X<sub>n</sub>] | τ}</tt>) = <tt>avg</tt>(<span style="text-decoration: overline"><i>S</i></span><sub>bag</sub>), if the function <tt>avg</tt> is defined for <span style="text-decoration: overline"><i>S</i></span><sub>bag</sub> in the dialect. If not, the value of the aggregate in <i><b>I</b></i> is indeterminate. The function <tt>avg</tt> must compute averages (arithmetic means) of the elements of finite bags. (For decimals, integers, floats, etc., average must coincide with the usual notion. However, this function might also be defined for other domains.)
</li>
</ul>
</li>
</ol>
</li>
<li>
For remote terms of the form <tt>φ@r</tt>, the mapping <i><b>I</b></i> is defined in Section <a href="#sec-interpretation-of-documents" title="">Interpretation of Documents</a>.
</li>
</ol>
<p><br />
Note that the definitions of <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>frame</sub>, and of <i><b>I</b></i>(<tt>x=y</tt>) imply that the terms with named arguments that differ only in the order of their arguments are mapped by <i><b>I</b></i> to the same element in the domain. Similarly, frame terms that differ only in the order of their attribute/value pairs (or in the number of repetitions of the same attribute/value pair) are mapped to the same domain element. This implies that the equalities like <tt>t(a->1 b->2 c->3) = t(c->3 a->2 b->2)</tt> and <tt>ex:o[ex:a->1 ex:b->"abc" ex:a->1] = ex:o[ex:b->"abc" ex:a->1]</tt> are tautologies in RIF-FLD.
</p><p><span class="anchor" id="the-effect-of-signatures"></span>
<i><b>The effect of signatures.</b></i> For every signature, <tt>sg</tt>, supported by a dialect, there is a subset <i><b>D</b></i><sub>sg</sub> ⊆ <i><b>D</b></i>, called the <i><b>domain of the signature</b></i>. Terms that have a given signature, <tt>sg</tt>, must be mapped by <i><b>I</b></i> to <i><b>D</b></i><sub>sg</sub>, and if a term has more than one signature it must be mapped into the intersection of the corresponding signature domains. To ensure this, the following is required:
</p>
<ol><li> If <tt>sg < sg'</tt> then <i><b>D</b></i><sub>sg</sub>⊆<i><b>D</b></i><sub>sg'</sub>.
</li><li> If <tt>k</tt> is a constant that has signature <tt>sg</tt> then <i><b>I</b></i><sub>C</sub>(<tt>k</tt>) ∈ <i><b>D</b></i><sub>sg</sub>.
</li><li> If <tt>?v</tt> is a variable that has signature <tt>sg</tt> then <i><b>I</b></i><sub>V</sub>(<tt>?v</tt>) ∈ <i><b>D</b></i><sub>sg</sub>.
</li><li> If <tt>sg</tt> has an arrow expression of the form (<tt>s1</tt> ... <tt>sn</tt>)⇒<tt>s</tt> then, for every <tt>d</tt>∈<i><b>D</b></i><sub>sg</sub>, <i><b>I</b></i><sub>F</sub>(<tt>d</tt>) must map <i><b>D</b></i><sub>s1</sub>× ... ×<i><b>D</b></i><sub>sn</sub> to <i><b>D</b></i><sub>s</sub>.
</li><li> If <tt>sg</tt> has an arrow expression of the form (<tt>p1->s1</tt> ... <tt>pn->sn</tt>)⇒<tt>s</tt> then, for every <tt>d</tt>∈<i><b>D</b></i><sub>sg</sub>, <i><b>I</b></i><sub>NF</sub>(<tt>d</tt>) must map the set {<<tt>p1</tt>,<i><b>D</b></i><sub>s1</sub>>, ..., <<tt>pn</tt>,<i><b>D</b></i><sub>sn</sub>>} to <i><b>D</b></i><sub>s</sub>.
</li><li> If the signature <tt>-></tt> has arrow expressions <tt>(sg,s<sub>1</sub>,r<sub>1</sub>)⇒k</tt>, ..., <tt>(sg,s<sub>n</sub>,r<sub>n</sub>)⇒k</tt>, then, for every <tt>d</tt>∈<i><b>D</b></i><sub>sg</sub>, <i><b>I</b></i><sub>frame</sub>(<tt>d</tt>) must map {<<i><b>D</b></i><sub>s1</sub>,<i><b>D</b></i><sub>r1</sub>>, ..., <<i><b>D</b></i><sub>sn</sub>,<i><b>D</b></i><sub>rn</sub>>} to <i><b>D</b></i><sub>k</sub>.
</li><li> If the signature <tt>#</tt> has an arrow expression <tt>(s r)⇒k</tt> then <i><b>I</b></i><sub>isa</sub> must map <i><b>D</b></i><sub>s</sub>×<i><b>D</b></i><sub>r</sub> to <i><b>D</b></i><sub>k</sub>.
</li><li> If the signature <tt>##</tt> has an arrow expression <tt>(s s)⇒k</tt> then <i><b>I</b></i><sub>sub</sub> must map <i><b>D</b></i><sub>s</sub>×<i><b>D</b></i><sub>s</sub> to <i><b>D</b></i><sub>k</sub>.
</li><li> If the signature <tt>=</tt> has an arrow expression <tt>(s s)⇒k</tt> then <i><b>I</b></i><sub>=</sub> must map <i><b>D</b></i><sub>s</sub>×<i><b>D</b></i><sub>s</sub> to <i><b>D</b></i><sub>k</sub>.
</li></ol>
<p><i><b>The effect of datatypes.</b></i> The datatype identifiers in <i><b>DTS</b></i> impose the following restrictions. If <tt>dt</tt> ∈ <i><b>DTS</b></i>, let <i><b>LS</b></i><sub>dt</sub> denote the lexical space of <tt>dt</tt>, <i><b>VS</b></i><sub>dt</sub> denote its value space, and <i><b>L</b></i><sub>dt</sub>: <i><b>LS</b></i><sub>dt</sub> → <i><b>VS</b></i><sub>dt</sub> the lexical-to-value-space mapping. Then the following must hold:
</p>
<ul><li> <i><b>VS</b></i><sub>dt</sub> ⊆ <i><b>D</b></i>; and
</li><li> For each constant <tt>"lit"^^dt</tt> such that <tt>lit</tt> ∈ <i><b>LS</b></i><sub>dt</sub>, <i><b>I</b></i><sub>C</sub>(<tt>"lit"^^dt</tt>) = <i><b>L</b></i><sub>dt</sub>(<tt>lit</tt>).
</li></ul>
<p>That is, <i><b>I</b></i><sub>C</sub> must map the constants of a datatype <tt>dt</tt> in accordance with <i><b>L</b></i><sub>dt</sub>. ☐
</p><p>RIF-FLD does not impose special requirements on <i><b>I</b></i><sub>C</sub> for constants in the symbol spaces that do not correspond to the identifiers of the datatypes in <i><b>DTS</b></i>. Dialects may have such requirements, however. An example of such a restriction could be a requirement that no constant in a particular symbol space (such as <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-local-space" title="DTB">rif:local</a></tt>) can be mapped to <i><b>VS</b></i><sub>dt</sub> of a datatype <tt>dt</tt>.
</p><p><br />
</p><p><span class="anchor" id="sec-semantics-metadata"></span>
</p>
<a id="Annotations_and_the_Formal_Semantics" name="Annotations_and_the_Formal_Semantics"></a><h4> <span class="mw-headline">3.5 Annotations and the Formal Semantics </span></h4>
<p>RIF-FLD annotations are stripped before the mappings that constitute RIF-FLD semantic structures are applied. Likewise, they are stripped before applying the truth valuation, <i>TVal</i><sub>I</sub>, defined in the next section. Thus, identifiers and metadata have no effect on the formal semantics.
</p><p>Note that although annotations associated with RIF-FLD formulas are ignored by the semantics, they can be extracted by XML tools. Since annotations are represented by frame terms, they can be reasoned with by the rules.
The frame terms used to represent metadata can then be fed to other formulas, thus enabling reasoning about metadata. However, RIF does not define any concrete semantics for metadata.
</p><p><br />
</p><p><span class="anchor" id="sec-interpretation-of-formulas"></span>
</p>
<a id="Interpretation_of_Non-document_Formulas" name="Interpretation_of_Non-document_Formulas"></a><h4> <span class="mw-headline">3.6 Interpretation of Non-document Formulas </span></h4>
<p>This section defines how a semantic structure, <i><b>I</b></i>, determines
the truth value <i>TVal</i><sub>I</sub>(<tt>φ</tt>) of a RIF-FLD formula, <tt>φ</tt>, where <tt>φ</tt> is any formula other than a document formula or a remote formula. Truth valuation of document formulas is defined in the next section.
</p><p>To this end, we define a mapping, <i>TVal</i><sub>I</sub>, from the set of all non-document formulas to <i><b>TV</b></i>. Note that the definition implies that <i>TVal</i><sub>I</sub>(<tt>φ</tt>) is defined <em>only if</em> the set <i><b>DTS</b></i> of the datatypes of <i><b>I</b></i> includes all the datatypes mentioned in <tt>φ</tt>.
</p><p><br />
</p><p><span class="anchor" id="def-fld-truth"></span>
<b>Definition (Truth valuation).</b>
<i><b>Truth valuation</b></i> for well-formed formulas in RIF-FLD is determined using the following function, denoted <i>TVal</i><sub>I</sub>:
</p>
<ol>
<li><i>Constants</i>: <i>TVal</i><sub>I</sub>(<tt>k</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>k</tt>)), if <tt>k</tt> ∈ <tt>Const</tt>. </li>
<li><i>Variables</i>: <i>TVal</i><sub>I</sub>(<tt>?v</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>?v</tt>)), if <tt>?v</tt> ∈ <tt>Var</tt>. </li>
<li><i>Positional atomic formulas</i>: <i>TVal</i><sub>I</sub>(<tt>r(t<sub>1</sub> ... t<sub>n</sub>)</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>r(t<sub>1</sub> ... t<sub>n</sub>)</tt>)).</li>
<li><i>Atomic formulas with named arguments</i>: <i>TVal</i><sub>I</sub>(<tt>p(s<sub>1</sub>->v<sub>1</sub> ... s<sub>k</sub>->v<sub>k</sub>)</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>p(s<sub>1</sub>-> v<sub>1</sub> ... s<sub>k</sub>->v<sub>k</sub>)</tt>)).</li>
<li><i>Equality</i>: <i>TVal</i><sub>I</sub>(<tt>x = y</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>x = y</tt>)).
<p>To ensure that equality has precisely the expected properties, it is required that
</p>
<ul>
<li>
<i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>x = y</tt>)) = <b>t</b> if <i><b>I</b></i>(<tt>x</tt>) = <i><b>I</b></i>(<tt>y</tt>) and that <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>x = y</tt>)) = <b>f</b> otherwise.
</li>
</ul>
</li>
<li><i>Subclass</i>: <i>TVal</i><sub>I</sub>(<tt>sc ## cl</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>sc ## cl</tt>)).
<p>
To ensure that the operator <tt>##</tt> is transitive, i.e., <tt>c1 ## c2</tt> and <tt>c2 ## c3</tt> imply <tt>c1 ## c3</tt>, the following is required:
</p>
<ul>
<li>
For all <tt>c1</tt>, <tt>c2</tt>, <tt>c3</tt> ∈ <i><b>D</b></i>, glb<sub>t</sub>(<i>TVal</i><sub>I</sub>(<tt>c1 ## c2</tt>), <i>TVal</i><sub>I</sub>(<tt>c2 ## c3</tt>)) ≤<sub>t</sub> <i>TVal</i><sub>I</sub>(<tt>c1 ## c3</tt>).
</li>
</ul>
<p>
Note that this is a restriction on <i><b>I</b></i><sub>truth</sub> and the mapping <i><b>I</b></i>, which is expressed in a more succinct form using <i>TVal</i><sub>I</sub>.
</p>
</li>
<li><i>Membership</i>: <i>TVal</i><sub>I</sub>(<tt>o # cl</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>o # cl</tt>)).
<p>To ensure that all members of a subclass are also members of the superclass, i.e., <tt>o # cl</tt> and <tt>cl ## scl</tt> imply <tt>o # scl</tt>, the following is required:
</p>
<ul>
<li>
For all <tt>o</tt>, <tt>cl</tt>, <tt>scl</tt> ∈ <i><b>D</b></i>, glb<sub>t</sub>(<i>TVal</i><sub>I</sub>(<tt>o # cl</tt>), <i>TVal</i><sub>I</sub>(<tt>cl ## scl</tt>)) ≤<sub>t</sub> <i>TVal</i><sub>I</sub>(<tt>o # scl</tt>).
</li>
</ul>
<p>
Note that this is a restriction on <i><b>I</b></i><sub>truth</sub> and the mapping <i><b>I</b></i>, which is expressed in a more succinct form using <i>TVal</i><sub>I</sub>.
</p>
</li>
<li><i>Frame</i>: <i>TVal</i><sub>I</sub>(<tt>o[a<sub>1</sub>->v<sub>1</sub> ... a<sub>k</sub>->v<sub>k</sub>]</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>o[a<sub>1</sub>->v<sub>1</sub> ... a<sub>k</sub>->v<sub>k</sub>]</tt>)).
<p>
Since the bag of attribute/value pairs represents the conjunction of all the pairs, the following is required:
</p>
<ul>
<li>
<i>TVal</i><sub>I</sub>(<tt>o[a<sub>1</sub>->v<sub>1</sub> ... a<sub>k</sub>->v<sub>k</sub>]</tt>) = glb<sub>t</sub>(<i>TVal</i><sub>I</sub>(<tt>o[a<sub>1</sub>->v<sub>1</sub>]</tt>), ..., <i>TVal</i><sub>I</sub>(<tt>o[a<sub>k</sub>->v<sub>k</sub>]</tt>)).
</li>
</ul>
<p>
Observe that this is a restriction on <i><b>I</b></i><sub>truth</sub> and the mapping <i><b>I</b></i>. For brevity, it is expressed in a more succinct form using <i>TVal</i><sub>I</sub>.
</p>
</li>
<li>
<i>Externally defined atomic formula</i>: <i>TVal</i><sub>I</sub>(<tt>External(t loc)</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i><sub>external</sub>(<tt>σ</tt>)(<i><b>I</b></i>(<tt>s<sub>1</sub></tt>), ..., <i><b>I</b></i>(<tt>s<sub>n</sub></tt>))), if <tt>External(t loc)</tt> is an atomic formula that is an instantiation of the external schema <tt>σ = (?X<sub>1</sub> ... ?X<sub>n</sub>; τ; loc)</tt> by substitution <tt>?X<sub>1</sub>/s<sub>1</sub> ... ?X<sub>n</sub>/s<sub>n</sub></tt>.
<p>
Note that, by definition, <tt>External(t loc)</tt> is well-formed only if it is an instantiation of an external schema. Furthermore, by the <a href="#def-fld-external-schema-set" title="">definition of coherent sets of external schemas</a>, it can be an instantiation of at most one external schema, so <i><b>I</b></i>(<tt>External(t loc)</tt>) is well-defined.
</p>
</li>
<li>
<i>Connectives and quantifiers</i>: if <tt>S</tt> is a connective or a quantifier and <tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt> is a well-formed formula term then <i>TVal</i><sub>I</sub>(<tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt>) =
<i><b>I</b></i><sub>truth</sub>(<i><b>I</b></i>(<tt>S(t<sub>1</sub> ... t<sub>n</sub>)</tt>)).
<p>
To ensure the intended semantics for the RIF-FLD reserved connectives and quantifiers, the following restrictions are imposed
(observe that all these are restrictions on <i><b>I</b></i><sub>truth</sub> and the mapping <i><b>I</b></i>, which are expressed via <i>TVal</i><sub>I</sub>, for brevity):
</p>
<ol style="list-style-type:lower-alpha">
<li>
<i>Conjunction</i>: <i>TVal</i><sub>I</sub>(<tt>And(c<sub>1</sub> ... c<sub>n</sub>)</tt>) = glb<sub>t</sub>(<i>TVal</i><sub>I</sub>(<tt>c<sub>1</sub></tt>), ..., <i>TVal</i><sub>I</sub>(<tt>c<sub>n</sub></tt>)).
<p>
The empty conjunction is treated as a tautology, so <i>TVal</i><sub>I</sub>(<tt>And()</tt>) = <b>t</b>.
</p>
</li>
<li>
<i>Disjunction</i>: <i>TVal</i><sub>I</sub>(<tt>Or(</tt>c<sub>1</sub> ... c<sub>n</sub><tt>)</tt>) = lub<sub>t</sub>(<i>TVal</i><sub>I</sub>(c<sub>1</sub>), ..., <i>TVal</i><sub>I</sub>(c<sub>n</sub>)).
<p>
The empty disjunction is treated as a contradiction, so <i>TVal</i><sub>I</sub>(<tt>Or()</tt>) = <b>f</b>.
</p>
</li>
<li><i>Negation</i>: <i>TVal</i><sub>I</sub>(<tt>Neg Neg φ</tt>) = <i>TVal</i><sub>I</sub>(<tt>φ</tt>) and <i>TVal</i><sub>I</sub>(<tt>Naf φ</tt>) = <tt>~</tt><i>TVal</i><sub>I</sub>(<tt>φ</tt>).
<p>The symbol <tt>~</tt> here is the self-inverse operator of negation on <i><b>TV</b></i> introduced in Section <a href="#sec-truth-values" title="">Truth Values</a>.
</p>
<p>
The symmetric negation, <tt>Neg</tt>, is sufficiently general to capture many different kinds of such negation. For instance, classical negation would, in addition, require <i>TVal</i><sub>I</sub>(<tt>Neg φ</tt>) = <tt>~</tt><i>TVal</i><sub>I</sub>(<tt>φ</tt>); strong negation (analogous to the one in [<a href="#ref-strong-explicit-negation" title="">APP96</a>]) can be characterized by <i>TVal</i><sub>I</sub>(<tt>Neg φ</tt>) ≤<sub>t</sub> <tt>~</tt><i>TVal</i><sub>I</sub>(<tt>φ</tt>); and explicit negation (analogous to [<a href="#ref-strong-explicit-negation" title="">APP96</a>]) would require no additional constraints.
</p>
<p>
Note that both classical and default negation are interpreted the same way in any concrete semantic structure. The difference between the two kinds of negation comes into play when logical entailment is defined.
</p>
</li>
<li><i>Quantification</i>:
<ul>
<li><i>TVal</i><sub>I</sub>(<tt>Exists ?v<sub>1</sub> ... ?v<sub>n</sub> (φ)</tt>) = lub<sub>t</sub>(<i>TVal</i><sub>I*</sub>(<tt>φ</tt>)).
</li>
<li><i>TVal</i><sub>I</sub>(<tt>Forall ?v<sub>1</sub> ... ?v<sub>n</sub> (φ)</tt>) = glb<sub>t</sub>(<i>TVal</i><sub>I*</sub>(<tt>φ</tt>)).
</li>
</ul>
<p>
Here lub<sub>t</sub> (respectively, glb<sub>t</sub>) is taken over all interpretations <i><b>I</b></i>* of the form <<i><b>TV</b></i>, <i><b>DTS</b></i>, <i><b>D</b></i>, <i><b>I</b></i><sub>C</sub>, <i><b>I</b></i>*<sub>V</sub>, <i><b>I</b></i><sub>F</sub>, <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>list</sub>, <i><b>I</b></i><sub>tail</sub>, <i><b>I</b></i><sub>frame</sub>, <i><b>I</b></i><sub>sub</sub>, <i><b>I</b></i><sub>isa</sub>, <i><b>I</b></i><sub>=</sub>, <i><b>I</b></i><sub>external</sub>, <i><b>I</b></i><sub>connective</sub>, <i><b>I</b></i><sub>truth</sub>>, which are exactly like <i><b>I</b></i>, except that the mapping <i><b>I</b></i>*<sub>V</sub>, is used instead of <i><b>I</b></i><sub>V</sub>. <i><b>I</b></i>*<sub>V</sub> is defined to coincide with <i><b>I</b></i><sub>V</sub> on all variables except, possibly, on <tt>?v<sub>1</sub></tt>,... ,<tt>?v<sub>n</sub></tt>.
</p>
</li>
<li><i>Rule implication</i>:
<ul>
<li><i>TVal</i><sub>I</sub>(<i>head</i> :- <i>body</i>) = <b>t</b>, if <i>TVal</i><sub>I</sub>(<i>head</i>) ≥<sub>t</sub> <i>TVal</i><sub>I</sub>(<i>body</i>).
</li>
<li>
<i>TVal</i><sub>I</sub>(<i>head</i> :- <i>body</i>) <<sub>t</sub> <b>t</b> otherwise.
</li>
</ul>
</li>
<li><i>Constraint</i>:
<ul>
<li><i>TVal</i><sub>I</sub>(:- <i>body</i>) = <b>t</b>, if <i>TVal</i><sub>I</sub>(<i>body</i>) = <b>f</b>.
</li>
<li>
<i>TVal</i><sub>I</sub>(:- <i>body</i>) <<sub>t</sub> <b>t</b> otherwise.
</li>
</ul>
</li>
<li>
Dialects that introduce additional connectives and quantifiers should define appropriate restrictions on <i>TVal</i><sub>I</sub> to give those new elements desired semantics.
</li>
</ol>
</li>
<li><i>Groups of formulas</i>:
<p>
If <tt>Γ</tt> is a group formula of the form <tt>Group(φ<sub>1</sub> ... φ<sub>n</sub>)</tt> then
</p>
<ul>
<li>
<i>TVal</i><sub>I</sub>(<tt>Γ</tt>) = glb<sub>t</sub>(<i>TVal</i><sub>I</sub>(<tt>φ<sub>1</sub></tt>), ..., <i>TVal</i><sub>I</sub>(<tt>φ<sub>n</sub></tt>)).
</li>
</ul>
<p>
This means that a group of formulas is treated as a conjunction. In particular, the empty group is treated as a tautology, so <i>TVal</i><sub>I</sub>(<tt>Group()</tt>) = <b>t</b>. ☐
</p>
</li>
</ol>
<p>
Note that rule implications and equality formulas are always two-valued, even if <i><b>TV</b></i> has more than two values.
</p>
<p><br />
</p><p><span class="anchor" id="sec-interpretation-of-documents"></span>
</p>
<a id="Interpretation_of_Documents" name="Interpretation_of_Documents"></a><h4> <span class="mw-headline">3.7 Interpretation of Documents </span></h4>
<p>Document formulas are interpreted using <i>semantic multi-structures</i>, which are
sets of semantic structures. Their purpose is to provide a semantics to RIF multi-documents, i.e., RIF documents that import other RIF documents and/or contain references to other RIF documents (via remote module refererence formulas). One interesting feature of the multi-document semantics is that <tt>rif:local</tt> constant symbols that belong to different documents can have different meanings.
</p><p><span class="anchor" id="def-fld-semantic-multistruct"></span>
<b>Definition (Semantic multi-structures).</b>
A <i><b>semantic multi-structure</b></i>, <b>Î</b>, is a set of semantic structures of the form
{<i><b>J</b></i>, <i><b>K</b></i>; <i><b>I</b></i><sup><tt>i<sub>1</sub></tt></sup>,
<i><b>I</b></i><sup><tt>i<sub>2</sub></tt></sup>, ...; <i><b>M</b></i><sup><tt>j<sub>1</sub></tt></sup>, <i><b>M</b></i><sup><tt>j<sub>2</sub></tt></sup>, ...}, where
</p>
<ul>
<li>
<i><b>J</b></i> and <i><b>K</b></i> are the usual <a href="#def-fld-sem-struct" title="">RIF-FLD semantic structures</a>; and
</li>
<li>
<i><b>I</b></i><sup><tt>i<sub>k</sub></tt></sup> and <i><b>M</b></i><sup><tt>j<sub>k</sub></tt></sup>, where <tt>k = 0, 1, 2, ...</tt>, are semantic structures <i><b>adorned</b></i> with <a href="#ref-locator" title="">locators</a> of RIF-FLD document formulas (one can think of adorned structures as locator-structure pairs).
</li>
</ul>
<p>The locators used in <b>Î</b> must be of the kinds allowed in the <a href="#ref-import-directive" title=""><tt>Import</tt> and <tt>Module</tt> directives</a>.
</p>
<p>
The first semantic structure, <i><b>J</b></i>, is used to interpret non-document formulas, as we shall see shortly. The structure <i><b>K</b></i> is used for document formulas. The structures in the middle group, <i><b>I</b></i><sup><tt>i<sub>k</sub></tt></sup>, are optional; they are used to interpret imported documents. All structures in that group must be adorned with the locators of distinct documents. The structures in the last group, <i><b>M</b></i><sup><tt>j<sub>k</sub></tt></sup>, are also optional; they are used to interpret documents that are linked as remote modules to other documents (via the <tt>Module</tt> directive). The structures in that group must also be adorned with locators of distinct documents. However, the same locator can adorn a structure in the import group and a structure in the module group.
</p>
<p>
The semantic structures <i><b>J</b></i>, <i><b>K</b></i>, and all the structures <i><b>I</b></i><sup><tt>i<sub>k</sub></tt></sup> in the import group are required to be identical in all respects except that
</p>
<ul>
<li>
The mappings, <i><b>J</b></i><sub>C</sub>, <i><b>K</b></i><sub>C</sub>, and <i><b>I</b></i><sub>C</sub><sup><tt>i<sub>k</sub></tt></sup> (for all <tt>i<sub>k</sub></tt>) may differ on those constants in <tt>Const</tt> that belong to the <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-local-space" title="DTB">rif:local</a></tt> symbol space.
</li>
</ul>
<p>The semantic structures <i><b>M</b></i><sup><tt>j<sub>k</sub></tt></sup> in the last group have many more degrees of freedom: they are required to agree with the other structures in <b>Î</b> only to the extent that the mappings <i><b>M</b></i><sub>C</sub><sup><tt>j<sub>k</sub></tt></sup> must coincide with <i><b>J</b></i><sub>C</sub>, <i><b>K</b></i><sub>C</sub>, and <i><b>I</b></i><sub>C</sub><sup><tt>i<sub>k</sub></tt></sup> on all constants in <tt>Const</tt> except the ones in the <tt>rif:local</tt> symbol space.
☐
</p><p>This definition makes the intent behind the <tt><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/#rif-local-space" title="DTB">rif:local</a></tt> constants clear: occurrences of these constants in different documents can be interpreted differently even if they have the same name. Therefore, each document can choose the names for the <tt>rif:local</tt> constants freely and without regard to the names of such constants used in the imported documents.
</p><p><br />
<span class="anchor" id="def-fld-semantic-imported-doc"></span>
<b>Definition (Imported document).</b>
Let <tt>Δ</tt> be a document formula and <tt>Import(<i>loc</i>)</tt> be one of its import directives, where <i>loc</i> is a locator of another document formula, <tt>Δ'</tt>. In this case, we say that <tt>Δ'</tt> is <i><b>directly imported</b></i> into <tt>Δ</tt>.
</p><p>A document formula <tt>Δ'</tt> is said to be <i><b>imported</b></i> into
<tt>Δ</tt> if it is either directly imported into <tt>Δ</tt> or it is imported (directly or not) into another document, which itself is directly imported into <tt>Δ</tt>.
☐
</p><p>The above definition deals only with one-argument import directives, since two-argument directives are expected to be defined on a case-by-case basis by other specifications that might be integrated with RIF. For instance, [<a href="#ref-rif-swc" title="">RIF-RDF+OWL</a>] defines the semantics of the 2-argument import directive for importing RDF and OWL documents into RIF-BLD.
</p><p><span class="anchor" id="def-semantic-linked-doc"></span>
<b>Definition (Remote module).</b>
Let <tt>Δ</tt> be a document formula and let <tt>Module(<i>n</i> <i>loc</i>)</tt> be one of its remote module directives, where <i>loc</i> is a locator for another document formula, <tt>Δ'</tt>. In this case, we say that <tt>Δ'</tt> is a <i><b>directly linked remote module</b></i> of <tt>Δ</tt>.
</p><p>A document formula <tt>Δ'</tt> is said to be a <i><b>linked remote module</b></i> for
<tt>Δ</tt> if it is either directly linked to <tt>Δ</tt> or it is linked (directly or not) to another document, which is directly linked to <tt>Δ</tt>.
☐
</p><p>Next, we extend the <a href="#def-term-interpreting-map" title="">term-interpreting mapping</a> associated with each semantic structure to the case of remote term references.
</p><p><span class="anchor" id="def-term-interp-map-module"></span>
<b>Definition (Term-interpreting mapping for remote term references).</b>
Let <tt>Δ</tt> be a document formula and
<b>Î</b> = {<i><b>J</b></i>, <i><b>K</b></i>; <i><b>I</b></i><sup><tt>i<sub>1</sub></tt></sup>,
<i><b>I</b></i><sup><tt>i<sub>2</sub></tt></sup>, ...; <i><b>M</b></i><sup><tt>j<sub>1</sub></tt></sup>,
<i><b>M</b></i><sup><tt>j<sub>2</sub></tt></sup>, ...}
be a semantic multi-structure that contains semantic structures for all the documents that are imported into <tt>Δ</tt> or linked to it as remote modules (directly or indirectly).
Let <tt>φ@r</tt> be a remote term that appears in <tt>Δ</tt> or one of its imported or linked documents, say <tt>Δ'</tt>, and let <i><b>L</b></i> <tt>∈</tt> <b>Î</b> be a semantic structure.
</p>
<p>
If there is a unique remote module directive <tt>Module(n j<sub>k</sub>)</tt> in <tt>Δ'</tt> such that <i><b>L</b></i>(<tt>r</tt>) = <i><b>L</b></i>(<tt>n</tt>) then
</p>
<ul>
<li>
<i><b>L</b></i>(<tt>φ@r</tt>) = <i><b>M</b></i><sup>j<sub>k</sub></sup>(<tt>φ</tt>).
</li>
</ul>
<p>
If no such remote module directive exists or if such a directive is not unique, then <i><b>L</b></i>(<tt>φ@r</tt>) is indeterminate, i.e., it can be any element in the domain of <i><b>L</b></i>.
</p>
<p>
Having extended the term-interpreting mapping to remote terms we can now extend the truth valuation to such terms:
</p>
<ul>
<li>
<i>TVal</i><sub>L</sub>(<tt>φ@r</tt>) = <i><b>I</b></i><sub>truth</sub>(<i><b>L</b></i>(<tt>φ@r</tt>)).
☐
</li>
</ul>
<p>Note that although the above definition is very general, in practice the terms that are used as remote module references (i.e., <tt>r</tt> in <tt>...@r</tt>) make sense only if they are interpreted by fixed and well-defined domain elements, and dialects are expected to impose the appropriate restrictions. Examples of such fixed interpretations include data types and <a href="#def-herbrand-domain" title="">Herbrand domains</a> [<a href="#ref-lloyd-87" title="">Lloyd87</a>].
</p><p><br />
We now use the notion of semantic multi-structures to define a semantics for RIF documents.
</p><p><span class="anchor" id="def-fld-truth-documents"></span>
<b>Definition (Truth valuation of document formulas).</b>
Let <tt>Δ</tt> be a document formula and let
<tt>Δ</tt><sub>1</sub>, ..., <tt>Δ</tt><sub>n</sub> be all the RIF-FLD document formulas that are <i>imported</i> (directly or indirectly, according to the previous definition) into <tt>Δ</tt>.
Let <tt>Γ</tt>, <tt>Γ<sub>1</sub></tt>, ..., <tt>Γ<sub>n</sub></tt> denote the respective group formulas <a href="#def-associated-group" title="">associated</a> with these documents.
Let <b>Î</b> = {<i><b>J</b></i>, <i><b>K</b></i>; <i><b>I</b></i><sup><tt>i<sub>1</sub></tt></sup>, <i><b>I</b></i><sup><tt>i<sub>2</sub></tt></sup>, ...; <i><b>M</b></i><sup><tt>j<sub>1</sub></tt></sup>, <i><b>M</b></i><sup><tt>j<sub>2</sub></tt></sup>, ...} be a semantic multi-structure whose import group contains semantic structures adorned with the locators <tt>i<sub>1</sub></tt>, ..., <tt>i<sub>n</sub></tt> of the documents <tt>Δ</tt><sub>1</sub>, ..., <tt>Δ</tt><sub>n</sub>.
Then we define:
</p>
<ul>
<li>
<i>TVal</i><sub>I</sub>(<tt>Δ</tt>) = glb<sub>t</sub>(<i>TVal</i><sub>K</sub>(<tt>Γ</tt>), <i>TVal</i><sub>I<sup><tt>i<sub>1</sub></tt></sup></sub>(<tt>Γ<sub>1</sub></tt>), ..., <i>TVal</i><sub>I<sup><tt>i<sub>n</sub></tt></sup></sub>(<tt>Γ<sub>n</sub></tt>)).
</li>
</ul>
<p>Observe that the structure <i><b>K</b></i><tt>∈</tt><b>Î</b> is used to interpret the main document, <tt>Γ</tt> and the structures <i><b>I</b></i><sup><tt>i<sub>1</sub></tt></sup>, ..., <i><b>I</b></i><sup><tt>i<sub>n</sub></tt></sup><tt>∈</tt><b>Î</b> interpret imported documents <tt>Γ</tt><sub>1</sub>, ..., <tt>Γ</tt><sub>n</sub>.
☐
</p><p>Note that this definition considers only those document formulas that are reachable via the one-argument import directives. Two-argument import directives are not covered by RIF-FLD. Their semantics is supposed to be defined by other documents, such as [<a href="#ref-rif-swc" title="">RIF-RDF+OWL</a>].
Also note that some of the <tt>Γ<sub>i</sub></tt> above may be missing since all parts in a document formula are optional. In this case, we assume that <tt>Γ<sub>i</sub></tt> is a tautology, such as <tt>And()</tt>, and every <i>TVal</i> function maps such a <tt>Γ<sub>i</sub></tt> to the truth value <b>t</b>.
</p><p>For non-document formulas, we extend <i>TVal</i><sub>I</sub>(<tt>φ</tt>) from regular semantic structures to multi-structures as follows: if <b>Î</b> is a multi-structure {<i><b>J</b></i>, <i><b>K</b></i>; ...} then <i>TVal</i><sub>Î</sub>(<tt>φ</tt>) = <i>TVal</i><sub>J</sub>(<tt>φ</tt>).
</p><p><span class="anchor" id="def-fld-model-formula"></span>
<b>Definition (Models).</b>
Let <i><b>I</b></i> be a semantic structure or multi-structure. We say that
<i><b>I</b></i> is a <i><b>model</b></i> of a formula, <tt>φ</tt>, written as <i><b>I</b></i><tt>|=φ</tt>, iff <i>TVal</i><sub>I</sub>(<tt>φ</tt>) = <b>t</b>.
Here <tt>φ</tt> can be a document or a non-document formula.
☐
</p><p>It is instructive to inspect the above definitions in order to understand how remote terms are interpreted by semantic multi-structures. Suppose <tt>φ@r</tt> is a remote term that occurs somewhere in the main document's group formula <tt>Γ</tt> or an imported document's group, say <tt>Γ<sub>1</sub></tt>. Let us assume <tt>Γ<sub>1</sub></tt>, for definiteness. By definition of truth valuations for document formulas, we would have to compute <i>TVal</i><sub>I<sup><tt>i<sub>1</sub></tt></sup></sub>(<tt>Γ<sub>1</sub></tt>), the truth valuation of <tt>Γ</tt><sub>1</sub>, with respect to the semantic structure <i><b>I</b></i><tt>i<sub>1</sub></tt>. To that end, we might eventually need to determine <i>TVal</i><sub>I<sup><tt>i<sub>1</sub></tt></sup></sub>(<tt>φ@r</tt>) at which point we will put the <a href="#def-term-interp-map-module" title="">definition of <i>TVal</i> for remote term references</a> to use. Note that <tt>φ</tt> can also contain a remote term reference (as <tt>φ</tt> can be a compound formula in its own right), and the definition of <i>TVal</i> for remote terms would have to be applied recursively.
</p><p><br />
<span class="anchor" id="sec-intended-models"></span>
</p>
<a id="Intended_Semantic_Structures" name="Intended_Semantic_Structures"></a><h4> <span class="mw-headline">3.8 Intended Semantic Structures </span></h4>
<p>The <i><b>semantics of a set of formulas</b></i>, <tt>Γ</tt>, is the set of its <i><b>intended</b></i> (or <i><b>preferred</b></i>) <i><b>semantic multi-structures</b></i>. Intended multi-structures are used to define the notion of logical entailment in RIF dialects. RIF-FLD does not fix what these intended multi-structures should be, leaving the choice to RIF dialects. Different logic dialects may use different criteria for what is to be considered an intended semantic multi-structure, and the freedom to set these criteria lets RIF-FLD cover a wide range of possible logical semantics. The actual choice of intended models for this or that logic dialect is a prerogative of the dialect designer and should be attempteed only by a trained logician.
</p><p>For instance, to model the classical first-order notion of entailment, every semantic structure would be intended. For [<a href="#ref-rif-bld" title="">RIF-BLD</a>], which is based on Horn rules, intended multi-structures are defined only for sets of rules: an intended semantic multi-structure of a RIF-BLD set of formulas, <tt>Γ</tt>, is the unique <a href="#def-minimal-model" title="">minimal Herbrand model</a> [<a href="#ref-lloyd-87" title="">Lloyd87</a>] of <tt>Γ</tt>. For dialects in which rule bodies may contain literals negated with the default negation connective <tt>Naf</tt>, only <i>some</i> of the minimal Herbrand models of <tt>Γ</tt> are intended. Each logic dialect of RIF must define the set of intended semantic multi-structures precisely. The two most common theories for default negation use the <i><b>well-founded models</b></i> [<a href="#ref-wf-model" title="">GRS91</a>] and <i><b>stable models</b></i> [<a href="#ref-stable-model" title="">GL88</a>] as their intended models.
</p><p>The following example illustrates the notion of intended semantic structures. Suppose <tt>Γ</tt> consists of a single rule formula <tt>p :- Naf q</tt>. If <tt>Naf</tt> were interpreted as classical negation, then this rule would be simply equivalent to <tt>Or(p q)</tt>, and so it would have two kinds of models: those where <tt>p</tt> is true and those where <tt>q</tt> is true. In contrast to first-order logic, most rule-based systems do not consider <tt>p</tt> and <tt>q</tt> symmetrically. Instead, they view the rule <tt>p :- Naf q</tt> as a statement that <tt>p</tt> must be true if it is not possible to establish the truth of <tt>q</tt>. Since it is, indeed, impossible to establish the truth of <tt>q</tt>, such theories would derive <tt>p</tt> even though it does not logically follow from <tt>Or(p q)</tt>. The logic underlying rule-based systems also assumes that only the <i>minimal</i> Herbrand models are intended (minimality here is with respect to the set of true facts). Furthermore, although our example has two minimal Herbrand models -- one where <tt>p</tt> is true and <tt>q</tt> is false, and the other where <tt>p</tt> is false, but <tt>q</tt> is true, only the first model is considered to be intended.
</p><p>The above concept of intended semantic multi-structures and the corresponding notion of logical entailment, below, is due to [<a href="#ref-shoham-87" title="">Shoham87</a>] (where these structures were called <i>preferred</i>).
</p><p><br />
<span class="anchor" id="sec-logical-entailment"></span>
</p>
<a id="Logical_Entailment" name="Logical_Entailment"></a><h4> <span class="mw-headline">3.9 Logical Entailment </span></h4>
<p>We will now define what it means for one RIF-FLD formula to entail another. This notion is typically used for defining queries to knowledge bases and for other tasks, such as testing subsumption of concepts (e.g., in OWL). We assume that each set of formulas has an associated set of intended semantic structures (which depend on RIF dialects).
</p><p><br />
<span class="anchor" id="def-fld-entailment"></span>
<b>Definition (Logical entailment).</b>
Let <tt>φ</tt> and <tt>ψ</tt> be (document or non-document) RIF-FLD formulas. We say that <tt>φ</tt> <i><b>entails</b></i> <tt>ψ</tt>, written as <tt>φ |= ψ</tt>, if and only if for every intended semantic multi-structure <b>Î</b> of <tt>φ</tt> it is the case that <i>TVal</i><sub>Î</sub>(<tt>φ</tt>) ≤<sub>t</sub> <i>TVal</i><sub>Î</sub>(<tt>ψ</tt>).
☐
</p><p>This general notion of entailment covers both first-order logic and the non-monotonic logics that underlie many rule-based languages; it extends the notion of entailment defined in [<a href="#ref-shoham-87" title="">Shoham87</a>] to the case of multi-valued logics.
</p><p><br />
Note that one consequence of the multi-document semantics is that local constants specified in one document cannot be queried from another document. For instance, if one document, <tt>Δ'</tt>, has the fact <tt>"http://example.com/ppp"^^rif:iri("abc"^^rif:local)</tt> while another document formula, <tt>Δ</tt>, imports <tt>Δ'</tt> and has the rule <tt>"http://example.com/qqq"^^rif:iri(?X) :- "http://example.com/ppp"^^rif:iri(?X) </tt>, then <tt>Δ |= "http://example.com/qqq"^^rif:iri("abc"^^rif:local)</tt> does <em>not</em> hold. This is because the symbol <tt>"abc"^^rif:local</tt> in <tt>Δ'</tt> and <tt>Δ</tt> is treated as different constants by semantic multi-structures.
</p><p>The behavior of local symbols should be contrasted with the behavior of <tt>rif:iri</tt> symbols. Suppose, in the above scenario, <tt>Δ'</tt> also has the fact <tt>"http://example.com/ppp"^^rif:iri("http://cde"^^rif:iri)</tt>. Then <tt>Δ |= "http://example.com/qqq"^^rif:iri("http:cde"^^rif:iri)</tt> <em>does</em> hold.
</p><p><span class="anchor" id="sec-fld-specialization-framework"></span>
</p>
<a id="XML_Serialization_Framework" name="XML_Serialization_Framework"></a><h2> <span class="mw-headline">4 XML Serialization Framework </span></h2>
<p>The RIF-FLD XML serialization framework defines
</p>
<ul><li> a <i>normative</i> mapping from the RIF-FLD presentation syntax to XML (Section <a href="#sec-translate-fld-to-xml" title="">Mapping from the RIF-FLD Presentation Syntax to the XML Syntax</a>), and
</li><li> a <i>normative</i> XML Schema for the XML syntax (Appendix <a href="#sec-xsd-fld" title="">XML Schema for FLD</a>).
</li></ul>
<p>As explained in the <a href="#sec-overview" title="">overview</a> section, the design of RIF envisions that the presentation syntaxes of future logic RIF dialects will be specializations of the presentation syntax of RIF-FLD. This means that every well-formed formula in the presentation syntax of a standard logic RIF dialect must also be well-formed in a specialization of RIF-FLD, which includes actualizing the RIF-FLD <a href="#ref-extension-point" title="">extension points</a> (see <a href="#sec-overview" title="">overview</a> section). The goal of the XML serialization framework is to provide a similar yardstick for the RIF XML syntax. This amounts to the requirement that any admissible XML document for a logic RIF dialect must also be an admissible XML document for a specialized RIF-FLD (<i>admissibility</i> is defined below). In terms of the presentation-to-XML syntax mappings, this means that each mapping for a logic RIF dialect must be a restriction of the corresponding mapping for RIF-FLD. For instance, the <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/#sec-translation" title="BLD">mapping from the presentation syntax of RIF-BLD to XML</a> in [<a href="#ref-rif-bld" title="">RIF-BLD</a>] is a restriction of the <a href="#sec-translate-fld-to-xml" title="">presentation-syntax-to-XML mapping for RIF-FLD</a>. In this way, RIF-FLD provides a framework for extensibility and mutual compatibility between XML syntaxes of RIF dialects.
</p><p>Recall that the syntax of RIF-FLD is not context-free and thus cannot be
fully captured by EBNF or XML Schema. Still, validity with respect to XML Schema can be a useful test. To reflect this state of affairs, we define two notions of syntactic correctness. The weaker notion checks correctness only with respect to XML Schema, while the stricter notion represents "true" syntactic correctness.
</p><p><span class="anchor" id="def-fld-specialized-schema"></span>
<b>Definition (Specialization of RIF-FLD schema to a dialect schema).</b>
If a dialect, <i>D</i>, specializes RIF-FLD then its XML schema must be a <i><b>specialization of the XML schema</b></i> of RIF-FLD. This includes elimination of some elements and attributes, restriction of the XML types of the others, and replacement of the <a href="#ref-extension-point" title="">extension points</a> with appropriate concrete elements of the specified (possibly restricted) types. ☐
</p><p><span class="anchor" id="def-fld-valid-xml"></span>
<b>Definition (Valid XML document in RIF-FLD).</b>
A <i><b>valid RIF-FLD document</b></i> in the XML syntax is an XML document that is valid with respect to the XML schema in Appendix <a href="#sec-xsd-fld" title="">XML Schema for RIF-FLD</a>, where the extension points <a href="#ref-newconective" title=""><tt>NEWCONNECTIVE</tt></a>, <a href="#ref-newquantifier" title=""><tt>NEWQUANTIFIER</tt></a>, <a href="#ref-newaggrfunc" title=""><tt>NEWAGGRFUNC</tt></a>, and <a href="#ref-newterm" title=""><tt>NEWTERM</tt></a> are specialized as concrete elements of the types prescribed by the RIF-FLD XML schema.
</p><p>If a dialect, <i>D</i>, specializes RIF-FLD then a <i><b>valid XML document in dialect</b></i> <i>D</i> is one that is valid with respect to the <a href="#def-fld-specialized-schema" title="">specialized XML schema</a> of <i>D</i>. ☐
</p><p><span class="anchor" id="def-fld-admissible-xml"></span>
<b>Definition (Admissible XML document in a logic dialect).</b>
An <i><b>admissible</b></i> RIF-FLD document in the XML syntax is a valid FLD document in that syntax that is the image of a well-formed RIF-FLD document in the presentation syntax (see Definition <a href="#def-fld-well-formed-formula" title="">Well-formed formula</a>) under the presentation-to-XML syntax mapping <tt>χ<sub>fld</sub></tt> defined in Section <a href="#sec-translate-fld-to-xml" title="">Mapping from the RIF-FLD Presentation Syntax to the XML Syntax</a>.
</p><p>If a dialect, <i>D</i>, specializes RIF-FLD then an XML document is admissible with respect to <i>D</i> if and only if it is a valid document in <i>D</i> and it is an image under <tt>χ<sub>D</sub></tt> of a well-formed document in the presentation syntax of <i>D</i>, where <tt>χ<sub>D</sub></tt> is the presentation-to-XML mapping defined by the dialect <i>D</i>.
</p><p>Note that if <i>D</i> requires the directive <tt>Dialect(<i>D</i>)</tt> as part of its syntax then this implies that any <i>D</i>-admissible document must have this directive. ☐
</p><p>A <i><b>round-tripping</b></i> of an admissible document in a dialect, <i>D</i>, is a semantics-preserving mapping to a document in any language <i>L</i> followed by a semantics-preserving mapping from the <i>L</i>-document back to an admissible <i>D</i>-document. While semantically equivalent, the original and the round-tripped <i>D</i>-documents need not be identical.
</p><p><br />
</p>
<a id="XML_for_the_RIF-FLD_Language" name="XML_for_the_RIF-FLD_Language"></a><h3> <span class="mw-headline">4.1 XML for the RIF-FLD Language </span></h3>
<p>RIF-FLD uses [<a href="#ref-xml-1-point-0" title="">XML1.0</a>] for its XML syntax. The XML serialization for RIF-FLD is <i>alternating</i> or <i>fully striped</i> [<a href="#ref-alternating-normal-form" title="">ANF01</a>]. A fully striped serialization views XML documents as objects and divides all XML tags into class descriptors, called <i>type tags</i>, and property descriptors, called <i>role tags</i> [<a href="#ref-type-and-role-tags" title="">TRT03</a>]. We follow the tradition of using capitalized names for type tags and lowercase names for role tags.
</p><p>The all-uppercase classes in the EBNF of the presentation syntax, such as <tt>FORMULA</tt>, become XML Schema groups in Appendix <a href="#sec-xsd-fld" title="">XML Schema for FLD</a>. They are not visible in instance markup. The other classes as well as non-terminals and symbols (such as <tt>Exists</tt> or <tt>=</tt>) become XML elements with optional attributes, as shown below.
</p><p><br />
The RIF serialization framework for the syntax of Section <a href="#sec-concrete-syntax" title="">EBNF Grammar for the Presentation Syntax of RIF-FLD</a> uses the following XML tags.
While there is a RIF-FLD element tag for the <tt>Import</tt> directive and an attribute for the <tt>Dialect</tt> directive, there are none for the <tt>Base</tt> and <tt>Prefix</tt> directives: they are handled as discussed in Section <a href="#sec-translate-fld-to-xml" title="">Mapping from the RIF-FLD Presentation Syntax to the XML Syntax</a>.
</p>
<pre>- Document (document, with optional 'dialect' attribute, containing optional directive and payload roles)
- directive (directive role, containing Import)
- payload (payload role, containing Group)
- Import (importation, containing location and optional profile)
- Module (remote module, associating internal name with location)
- location (location role, containing ANYURICONST)
- internal (internal role, containing variable-free term as remote module name)
- profile (profile role, containing PROFILE)
- Group (nested collection of sentences)
- sentence (sentence role, containing FORMULA or Group)
- Forall (quantified formula for 'Forall', containing declare and formula roles)
- Exists (quantified formula for 'Exists', containing declare and formula roles)
- declare (declare role, containing a Var)
- formula (formula role, containing a FORMULA)
- termula (termula role, containing a TERMULA)
- Implies (implication, containing if and then roles)
- if (antecedent role, containing FORMULA)
- then (consequent role, containing FORMULA)
- And (conjunction)
- Or (disjunction)
- Neg (strong negation, containing a formula role)
- Naf (default negation, containing a formula role)
- Atom (atom formula, positional or with named arguments)
- Remote (prefix version of remote term '@', containing a formula/termula and an internal role)
- External (external call, containing a content role)
- content (content role, containing an Atom, for predicates, or Expr, for functions)
- Member (member formula)
- Subclass (subclass formula)
- Frame (Frame formula)
- object (Member/Frame role containing a TERM or an object description)
- op (Atom/Expr role for predicates/functions as operations)
- args (Atom/Expr positional arguments role, with fixed 'ordered' attribute, containing n TERMs)
- instance (Member instance role)
- class (Member class role)
- sub (Subclass sub-class role)
- super (Subclass super-class role)
- slot (Atom/Expr or Frame slot role, with fixed 'ordered' attribute, containing a Name or TERM followed by a TERM)
- Equal (prefix version of term equation '=')
- left (Equal left-hand side role)
- right (Equal right-hand side role)
- Expr (expression formula, positional or with named arguments)
- List (list term, closed or open)
- items (list items role, with ordered="yes" attribute, containing n TERMs)
- rest (list rest role, corresponding to '|')
- Min (aggregate function)
- Max (aggregate function)
- Sum (aggregate function)
- Prod (aggregate function)
- Avg (aggregate function)
- Count (aggregate function)
- Set (aggregate function)
- Bag (aggregate function)
- Const (individual, function, or predicate symbol, with optional 'type' attribute)
- Name (name of named argument)
- Var (logic variable)
- id (identifier role, containing CONST)
- meta (meta role, containing metadata as a Frame or Frame conjunction)
</pre>
<p>The name of a prefix is not associated with an XML element, since it is handled via preprocessing as discussed in Section <a href="#sec-translation-non-annotated-language" title="">Mapping of the Non-annotated RIF-FLD Language</a>.
</p><p>The <tt>id</tt> and <tt>meta</tt> elements, which are expansions of the <tt>IRIMETA</tt> element, can occur optionally as the initial children of any Class element.
</p><p>The XML Schema Definition of RIF-FLD is given in Appendix <a href="#sec-xsd-fld" title="">XML Schema for FLD</a>.
</p><p>The XML syntax for symbol spaces uses the <tt>type</tt> attribute associated with the XML element <tt>Const</tt>. For instance, a literal in the <tt>xs:dateTime</tt> datatype is represented as <tt><Const type="&xs;dateTime">2007-11-23T03:55:44-02:30</Const></tt>.
</p><p>The <tt>xml:lang</tt> attribute, as defined by <a class="external text" href="http://www.w3.org/TR/REC-xml/#sec-lang-tag" title="http://www.w3.org/TR/REC-xml/#sec-lang-tag">2.12 Language Identification</a> of <a class="external text" href="http://www.w3.org/TR/2000/REC-xml-20001006" title="http://www.w3.org/TR/2000/REC-xml-20001006">XML 1.0</a> or its successor specifications in the W3C recommendation track, is optionally used to identify the language for the presentation of the <tt>Const</tt> to the user. It is allowed only in association with constants of the type <tt>rdf:plainLiteral</tt>. A compliant implementation MUST ignore the <tt>xml:lang</tt> attribute if the type of the <tt>Const</tt> is not <tt>rdf:plainLiteral</tt>.
</p><p>RIF-FLD also uses the <tt>ordered</tt> attribute to indicate that the children of
<tt>args</tt> and <tt>slot</tt> elements are ordered.
</p>
<p>
<b>Example 5</b> (Serialization of a nested RIF-FLD group with annotations).
</p>
<p>This example shows an XML serialization for the formulas in Example 3. For convenience of reference, the original formulas are included at the top. For better readability, we again use the shortcut syntax defined in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>].
</p>
<pre>Presentation syntax:
Document(
Dialect(FOL)
Base(<http://www.shakespeare-literature.com/Hamlet/>)
Prefix(dc <http://<a class="external free" href="http://purl.org/dc/terms/" title="http://purl.org/dc/terms/">http://purl.org/dc/terms/</a>>)
Prefix(ex <http://example.org/ontology#>)
(* <assertions> <assertions>[dc:title->"Hamlet" dc:creator->"Shakespeare"] *)
Group(
Exists ?X (And(?X # ex:RottenThing
ex:partof(?X <http://www.denmark.dk>)))
Forall ?X (Or(<tobe>(?X) Naf <tobe>(?X)))
Forall ?X (And(Exists ?B (And(ex:has(?X ?B) ?B # ex:business))
Exists ?D (And(ex:has(?X ?D) ?D # ex:desire)))
:- ?X # ex:man)
(* <facts> *)
Group(
<Yorick> # ex:poor
<Hamlet> # ex:prince
)
)
)
XML serialization:
<!DOCTYPE Document [
<!ENTITY dc "http://purl.org/dc/terms/">
<!ENTITY ex "http://example.org/ontology#">
<!ENTITY rif "http://www.w3.org/2007/rif#">
<!ENTITY xs "http://www.w3.org/2001/XMLSchema#">
]>
<Document
xml:base="http://www.shakespeare-literature.com/Hamlet/">
dialect="FOL">
<payload>
<Group>
<meta>
<Frame>
<object>
<Const type="&rif;iri">assertions</Const>
</object>
<slot ordered="yes">
<Const type="&rif;iri">&dc;title</Const>
<Const type="&xs;string">Hamlet</Const>
</slot>
<slot ordered="yes">
<Const type="&rif;iri">&dc;creator</Const>
<Const type="&xs;string">Shakespeare</Const>
</slot>
</Frame>
</meta>
<sentence>
<Exists>
<declare><Var>X</Var></declare>
<formula>
<And>
<formula>
<Member>
<instance><Var>X</Var></instance>
<class><Const type="&rif;iri">ex:RottenThing</Const></class>
</Member>
</formula>
<formula>
<Atom>
<op><Const type="&rif;iri">ex:partof</Const></op>
<args ordered="yes">
<Var>X</Var>
<Const type="&rif;iri">http://www.denmark.dk</Const>
</args>
</Atom>
</formula>
</And>
</formula>
</Exists>
</sentence>
<sentence>
<Forall>
<declare><Var>X</Var></declare>
<formula>
<Or>
<formula>
<Atom>
<op><Const type="&rif;iri">tobe</Const></op>
<args ordered="yes"><Var>X</Var></args>
</Atom>
</formula>
<formula>
<Naf>
<formula>
<Atom>
<op><Const type="&rif;iri">tobe</Const></op>
<args ordered="yes"><Var>X</Var></args>
</Atom>
</formula>
</Naf>
</formula>
</Or>
</formula>
</Forall>
</sentence>
<sentence>
<Forall>
<declare><Var>X</Var></declare>
<formula>
<Implies>
<if>
<Member>
<instance><Var>X</Var></instance>
<class><Const type="&rif;iri">ex:man</Const></class>
</Member>
</if>
<then>
<And>
<formula>
<Exists>
<declare><Var>B</Var></declare>
<formula>
<And>
<formula>
<Atom>
<op><Const type="&rif;iri">ex:has</Const></op>
<args>
<Var>X</Var>
<Var>B</Var>
</args>
</Atom>
</formula>
<formula>
<Member>
<instance><Var>B</Var></instance>
<class><Const type="&rif;iri">ex:business</Const></class>
</Member>
</formula>
</And>
</formula>
</Exists>
</formula>
<formula>
<Exists>
<declare><Var>D</Var></declare>
<formula>
<And>
<formula>
<Atom>
<op><Const type="&rif;iri">ex:has</Const></op>
<args>
<Var>X</Var>
<Var>D</Var>
</args>
</Atom>
</formula>
<formula>
<Member>
<instance><Var>D</Var></instance>
<class><Const type="&rif;iri">ex:desire</Const></class>
</Member>
</formula>
</And>
</formula>
</Exists>
</formula>
</And>
</then>
</Implies>
</formula>
</Forall>
</sentence>
<sentence>
<Group>
<meta>
<Frame>
<object>
<Const type="&rif;iri">facts</Const>
</object>
</Frame>
</meta>
<sentence>
<Member>
<instance><Const type="&rif;iri">Yorick</Const></instance>
<class><Const type="&rif;iri">ex:poor</Const></class>
</Member>
</sentence>
<sentence>
<Member>
<instance><Const type="&rif;iri">Hamlet</Const></instance>
<class><Const type="&rif;iri">ex:prince</Const></class>
</Member>
</sentence>
</Group>
</sentence>
</Group>
</payload>
</Document>
</pre>
<p><br />
<span class="anchor" id="sec-translate-fld-to-xml"></span>
</p>
<a id="Mapping_from_the_RIF-FLD_Presentation_Syntax_to_the_XML_Syntax" name="Mapping_from_the_RIF-FLD_Presentation_Syntax_to_the_XML_Syntax"></a><h3> <span class="mw-headline">4.2 Mapping from the RIF-FLD Presentation Syntax to the XML Syntax </span></h3>
<p>This section defines a normative mapping, <tt>χ<sub>fld</sub></tt>, from the presentation syntax of Section <a href="#sec-concrete-syntax" title="">EBNF Grammar for the Presentation Syntax of RIF-FLD</a> to the XML syntax of RIF-FLD.
The mapping is given via tables where each row specifies the mapping of a particular syntactic pattern in the presentation syntax. These patterns appear in the first column of the tables and the <i><b>bold-italic</b></i> symbols represent metavariables. The second column represents the corresponding XML patterns, which may contain applications of the mapping <tt>χ<sub>fld</sub></tt> to these metavariables. When an expression <tt>χ<sub>fld</sub></tt><tt>(<b><i>metavar</i></b>)</tt> occurs in an XML pattern in the right column of a translation table, it should be understood as a recursive application of <tt>χ<sub>fld</sub></tt> to the presentation syntax represented by the metavariable. The XML syntax result of such an application is substituted for the expression <tt>χ<sub>fld</sub></tt><tt>(<b><i>metavar</i></b>)</tt>.
A sequence of terms containing metavariables with subscripts is indicated by an ellipsis.
A metavariable or a well-formed XML subelement is marked as optional by appending a bold-italic question mark, <i><b>?</b></i>, to its right.
</p><p><br />
<span class="anchor" id="sec-translation-non-annotated-language"></span>
</p>
<a id="Mapping_of_the_Non-annotated_RIF-FLD_Language" name="Mapping_of_the_Non-annotated_RIF-FLD_Language"></a><h4> <span class="mw-headline">4.2.1 Mapping of the Non-annotated RIF-FLD Language </span></h4>
<p>The <tt>χ<sub>fld</sub></tt> mapping from the presentation syntax to the XML syntax of the non-annotated RIF-FLD Language is given by the table below.
Each row indicates a translation
<tt>χ<sub>fld</sub></tt>(<tt>Presentation</tt>) = <tt>XML</tt>. The function <tt><i>remove-outer-quotes</i></tt> used in the translation removes enclosing double quotes from a string and leaves unquoted strings untouched. Since the presentation syntax of RIF-FLD is context sensitive, the mapping must differentiate between the terms that occur in the position of the individuals and the terms that occur as atomic formulas. To this end, in the translation table, the positional and named-argument terms that occur in the context of atomic formulas are denoted by the expressions of the form <i><b>pred</b></i>(...) and the terms that occur as individuals are denoted by expressions of the form <i><b>func</b></i>(...).
In the table, each metavariable for an (unnamed) positional <i><b>argument<sub>i</sub></b></i> is assumed to be instantiated to values unequal to the instantiations of named arguments <i><b>name<sub>j</sub></b></i> <tt>-></tt> <i><b>filler<sub>j</sub></b></i>. Regarding the last but first row, we assume that shortcuts for constants [<a href="#ref-rif-dtb" title="">RIF-DTB</a>] have already been expanded to their full form (<tt>"..."^^</tt><i><b>symspace</b></i>).
The <tt><i><b>AGGRFUNC</b></i></tt> metavariable stands for any of the aggregation functions <tt>Min</tt>, <tt>Max</tt>, <tt>Count</tt>, <tt>Avg</tt>, <tt>Sum</tt>, <tt>Prod</tt>, <tt>Set</tt>, <tt>Bag</tt>, or <tt>NEWAGGRFUNC</tt>.
</p><p>Thus, the mapping of the extension point for aggregate functions (<a href="#ref-newaggrfunc" title=""><tt>NEWAGGRFUNC</tt></a>) is handled by the <i><b>AGGRFUNC</b></i> metavariable, along with the mapping of the specific aggregate functions (<tt>Min</tt> etc.).
The mapping of the extension points for quantifiers (<a href="#ref-newquantifier" title=""><tt>NEWQUANTIFIER</tt></a>) and connectives (<a href="#ref-newconective" title=""><tt>NEWCONNECTIVE</tt></a>) generalizes the mapping for the specific quantifiers (<tt>Forall</tt>, <tt>Exists</tt>) and connectives (<tt>And</tt>, <tt>Or</tt>), respectively.
The mapping of the extension point for terms (<a href="#ref-newterm" title=""><tt>NEWTERM</tt></a>) keeps <tt>NEWTERM</tt> entirely unconstrained in the presentation syntax and uses a wildcard content model (indicated by ellipses) in the XML syntax. This is because the content of <tt>NEWTERM</tt> is left entirely up to RIF dialects.
Recall that the extension point for symbols (<a href="#ref-newsymbol" title=""><tt>NEWSYMBOL</tt></a>) is part of the alphabet and is not dealt with in the EBNF and XML grammars.
</p><p>Also recall that <tt>OpenList(t</tt><sub>1</sub> ... <tt>t</tt><sub>m</sub> <tt>t)</tt> is just an alternative form for <tt>List(t</tt><sub>1</sub> ... <tt>t</tt><sub>m</sub> | <tt>t)</tt>, so its mapping is not represented separately.
</p><p>Note that the <tt>Import</tt> and <tt>Dialect</tt> directives are handled by the presentation-to-XML syntax mapping, using an XML attribute for <tt>dialect</tt> names (values: <tt>FOL</tt>, <tt>BLD</tt>, <tt>Core</tt>, etc.). On the other hand, the <tt>Prefix</tt> and <tt>Base</tt> directives are not handled by this mapping but by expanding the associated shortcuts (compact URIs).
Namely, a prefix name declared in a <tt>Prefix</tt> directive is expanded into the associated IRI, while relative IRIs are completed using the IRI declared in the <tt>Base</tt> directive. The mapping <tt>χ<sub>fld</sub></tt> applies only to such expanded documents.
RIF-FLD also allows other treatments of <tt>Prefix</tt> and <tt>Base</tt> provided that they produce equivalent XML documents. One such treatment is employed in the examples in this document, especially Example 5. It replaces prefix names with definitions of XML entities as follows.
Each <tt>Prefix</tt> declaration becomes an <tt>ENTITY</tt> declaration [<a href="#ref-xml-1-point-0" title="">XML1.0</a>] within a <tt>DOCTYPE</tt> DTD attached to the RIF-FLD <tt>Document</tt>. The <tt>Base</tt> directive is mapped to the <tt>xml:base</tt> attribute [<a href="#ref-xml-base" title="">XML-Base</a>] in the XML <tt>Document</tt> tag.
Compact URIs of the form <tt>prefix:suffix</tt> are then mapped to <tt>&prefix;suffix</tt>.
</p>
<table class="syntax-translation-table">
<tr>
<th colspan="1" rowspan="1"> Presentation Syntax
</th><th colspan="1" rowspan="1"> XML Syntax
</th></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Document(
Dialect(<i><b>name</b></i>)<i><b>?</b></i>
Import(<i><b>iloc<sub>1</sub></b></i> <i><b>prfl<sub>1</sub>?</b></i>)
. . .
Import(<i><b>iloc<sub>n</sub></b></i> <i><b>prfl<sub>n</sub>?</b></i>)
Module(<i><b>name<sub>1</sub></b></i> <i><b>mloc<sub>1</sub></b></i>)
. . .
Module(<i><b>name<sub>k</sub></b></i> <i><b>mloc<sub>k</sub></b></i>)
<i><b>group</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Document dialect="<i><b>name</b></i>"<i><b>?</b></i>>
<directive>
<Import>
<location><tt>χ<sub>fld</sub></tt>(<i><b>iloc<sub>1</sub></b></i>)</location>
<profile><tt>χ<sub>fld</sub></tt>(<i><b>prfl<sub>1</sub></b></i>)</profile><i><b>?</b></i>
</Import>
</directive>
. . .
<directive>
<Import>
<location><tt>χ<sub>fld</sub></tt>(<i><b>iloc<sub>n</sub></b></i>)</location>
<profile><tt>χ<sub>fld</sub></tt>(<i><b>prfl<sub>n</sub></b></i>)</profile><i><b>?</b></i>
</Import>
</directive>
<directive>
<Module>
<internal><tt>χ<sub>fld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</internal>
<location><tt>χ<sub>fld</sub></tt>(<i><b>mloc<sub>1</sub></b></i>)</location>
</Module>
</directive>
. . .
<directive>
<Module>
<internal><tt>χ<sub>fld</sub></tt>(<i><b>name<sub>k</sub></b></i>)</internal>
<location><tt>χ<sub>fld</sub></tt>(<i><b>mloc<sub>k</sub></b></i>)</location>
</Module>
</directive>
<payload><tt>χ<sub>fld</sub></tt>(<i><b>group</b></i>)</payload>
</Document>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Group(
<i><b>clause<sub>1</sub></b></i>
. . .
<i><b>clause<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Group>
<sentence><tt>χ<sub>fld</sub></tt>(<i><b>clause<sub>1</sub></b></i>)</sentence>
. . .
<sentence><tt>χ<sub>fld</sub></tt>(<i><b>clause<sub>n</sub></b></i>)</sentence>
</Group>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Forall
<i><b>variable<sub>1</sub></b></i>
. . .
<i><b>variable<sub>n</sub></b></i> (
<i><b>body</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Forall>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>1</sub></b></i>)</declare>
. . .
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>n</sub></b></i>)</declare>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>body</b></i>)</formula>
</Forall>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Exists
<i><b>variable<sub>1</sub></b></i>
. . .
<i><b>variable<sub>n</sub></b></i> (
<i><b>body</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Exists>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>1</sub></b></i>)</declare>
. . .
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>n</sub></b></i>)</declare>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>body</b></i>)</formula>
</Exists>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>NEWQUANTIFIER
<i><b>variable<sub>1</sub></b></i>
. . .
<i><b>variable<sub>n</sub></b></i> (
<i><b>body</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><NEWQUANTIFIER>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>1</sub></b></i>)</declare>
. . .
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>n</sub></b></i>)</declare>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>body</b></i>)</formula>
</NEWQUANTIFIER>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>conclusion</b></i> :- <i><b>condition</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Implies>
<if><tt>χ<sub>fld</sub></tt>(<i><b>condition</b></i>)</if>
<then><tt>χ<sub>fld</sub></tt>(<i><b>conclusion</b></i>)</then>
</Implies>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>And (
<i><b>conjunct<sub>1</sub></b></i>
. . .
<i><b>conjunct<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><And>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>conjunct<sub>1</sub></b></i>)</formula>
. . .
<formula><tt>χ<sub>fld</sub></tt>(<i><b>conjunct<sub>n</sub></b></i>)</formula>
</And>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Or (
<i><b>disjunct<sub>1</sub></b></i>
. . .
<i><b>disjunct<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Or>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>disjunct<sub>1</sub></b></i>)</formula>
. . .
<formula><tt>χ<sub>fld</sub></tt>(<i><b>disjunct<sub>n</sub></b></i>)</formula>
</Or>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>NEWCONNECTIVE (
<i><b>argument<sub>1</sub></b></i>
. . .
<i><b>argument<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><NEWCONNECTIVE>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>1</sub></b></i>)</formula>
. . .
<formula><tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>n</sub></b></i>)</formula>
</NEWCONNECTIVE>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Neg <i><b>form</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Neg>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>form</b></i>)</formula>
</Neg>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>Naf <i><b>form</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Naf>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>form</b></i>)</formula>
</Naf>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>query</b></i> @ <i><b>modref</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Remote>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>query</b></i>)</formula>
<internal><tt>χ<sub>fld</sub></tt>(<i><b>modref</b></i>)</internal>
</Remote>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>External (
<i><b>atomframexpr</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><External>
<content><tt>χ<sub>fld</sub></tt>(<i><b>atomframexpr</b></i>)</content>
</External>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>pred</b></i> (
<i><b>argument<sub>1</sub></b></i>
. . .
<i><b>argument<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Atom>
<op><tt>χ<sub>fld</sub></tt>(<i><b>pred</b></i>)</op>
<args ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>n</sub></b></i>)
</args>
</Atom>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>func</b></i> (
<i><b>argument<sub>1</sub></b></i>
. . .
<i><b>argument<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Expr>
<op><tt>χ<sub>fld</sub></tt>(<i><b>func</b></i>)</op>
<args ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>n</sub></b></i>)
</args>
</Expr>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>List (
<i><b>element<sub>1</sub></b></i>
. . .
<i><b>element<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><List>
<items ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>n</sub></b></i>)
</items>
</List>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>List (
<i><b>element<sub>1</sub></b></i>
. . .
<i><b>element<sub>n</sub></b></i>
|
<i><b>remainder</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><List>
<items ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>n</sub></b></i>)
</items>
<rest><tt>χ<sub>fld</sub></tt>(<i><b>remainder</b></i>)</rest>
</List>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>pred</b></i> (
<i><b>name<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>name<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Atom>
<op><tt>χ<sub>fld</sub></tt>(<i><b>pred</b></i>)</op>
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>n</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Atom>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>func</b></i> (
<i><b>name<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>name<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Expr>
<op><tt>χ<sub>fld</sub></tt>(<i><b>func</b></i>)</op>
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>n</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Expr>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>inst</b></i> [
<i><b>key<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>key<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
]
</pre>
</td><td colspan="1" rowspan="1">
<pre><Frame>
<object><tt>χ<sub>fld</sub></tt>(<i><b>inst</b></i>)</object>
<slot ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>key<sub>1</sub></b></i>)
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>key<sub>n</sub></b></i>)
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Frame>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>inst</b></i> # <i><b>class</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Member>
<instance><tt>χ<sub>fld</sub></tt>(<i><b>inst</b></i>)</instance>
<class><tt>χ<sub>fld</sub></tt>(<i><b>class</b></i>)</class>
</Member>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>sub</b></i> ## <i><b>super</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Subclass>
<sub><tt>χ<sub>fld</sub></tt>(<i><b>sub</b></i>)</sub>
<super><tt>χ<sub>fld</sub></tt>(<i><b>super</b></i>)</super>
</Subclass>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>left</b></i> = <i><b>right</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Equal>
<left><tt>χ<sub>fld</sub></tt>(<i><b>left</b></i>)</left>
<right><tt>χ<sub>fld</sub></tt>(<i><b>right</b></i>)</right>
</Equal>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>AGGRFUNC</b></i> {
<i><b>variable</b></i>
<i><b>variable<sub>1</sub></b></i>
. . .
<i><b>variable<sub>m</sub></b></i>
|
<i><b>compform</b></i>
}
</pre>
</td><td colspan="1" rowspan="1">
<pre><<i><b>AGGRFUNC</b></i>>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable</b></i>)</declare>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>1</sub></b></i>)</declare>
. . .
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>m</sub></b></i>)</declare>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>compform</b></i>)</formula>
</<i><b>AGGRFUNC</b></i>>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>"<i><b>unicodestring</b></i>"^^<i><b>space</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Const type="<i><b>space</b></i>"><i><b>unicodestring</b></i></Const>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>?<i><b>name<sub>1</sub></b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</Name>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>NEWTERM
</pre>
</td><td colspan="1" rowspan="1">
<pre><NEWTERM>...</NEWTERM>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre><i><b>name<sub>i</sub></b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre> <i>remove-outer-quotes</i>(<i><b>name<sub>i</sub></b></i>)
</pre>
</td></tr></table>
<a id="Mapping_of_RIF-FLD_Annotations" name="Mapping_of_RIF-FLD_Annotations"></a><h4> <span class="mw-headline">4.2.2 Mapping of RIF-FLD Annotations </span></h4>
<p>The <tt>χ<sub>fld</sub></tt> mapping from RIF-FLD annotations in the presentation syntax to the XML syntax is specified by the table below.
It extends the translation table of Section <a href="#sec-translation-non-annotated-language" title="">Mapping of the Non-annotated RIF-FLD Language</a>.
The metavariable <i><b>Typetag</b></i> in the presentation and XML syntaxes stands for any of the class names <tt>And</tt>, <tt>Or</tt>, <tt>External</tt>, <tt>Document</tt>, or <tt>Group</tt>, <i><b>Quantifier</b></i> for <tt>Exists</tt> or <tt>Forall</tt>, and <i><b>Negation</b></i> for <tt>Neg</tt> or <tt>Naf</tt>. The dollar sign, <b>$</b>, stands for any of the binary infix operator names <tt>#</tt>, <tt>##</tt>, <tt>=</tt>, <tt>:-</tt>, or <tt>@</tt>, while <i><b>Binop</b></i> stands for their respective class names <tt>Member</tt>, <tt>Subclass</tt>, <tt>Equal</tt>, <tt>Implies</tt>, or <tt>Remote</tt>.
The metavariable <i><b>attr?</b></i> is used with <i><b>Typetag</b></i> to capture the optional <tt>dialect</tt> attribute (with its value) of <tt>Document</tt>.
Again, each metavariable for an (unnamed) positional <i><b>argument<sub>i</sub></b></i> is assumed to be instantiated to values unequal to the instantiations of named arguments <i><b>name<sub>j</sub></b></i> <tt>-></tt> <i><b>filler<sub>j</sub></b></i>.
</p>
<table class="syntax-translation-table">
<tr>
<th colspan="1" rowspan="1"> Presentation Syntax
</th><th colspan="1" rowspan="1"> XML Syntax
</th></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>Typetag</b></i> ( <i><b>e<sub>1</sub></b></i> . . . <i><b>e<sub>n</sub></b></i> )
</pre>
</td><td colspan="1" rowspan="1">
<pre><<i><b>Typetag</b></i> <i><b>attr?</b></i>>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<i><b>e<sub>1</sub>'</b></i> . . . <i><b>e<sub>n</sub>'</b></i>
</<i><b>Typetag</b></i>>
<tt>where <i><b>attr</b></i>, <i><b>e<sub>1</sub>'</b></i>, . . ., <i><b>e<sub>n</sub>'</b></i> are defined by the equation</tt>
<tt>χ<sub>fld</sub></tt><tt>(<i><b>Typetag</b></i>(<i><b>e<sub>1</sub></b></i> . . . <i><b>e<sub>n</sub></b></i>)) = <<i><b>Typetag</b></i> <i><b>attr?</b></i>><i><b>e<sub>1</sub>'</b></i> . . . <i><b>e<sub>n</sub>'</b></i></<i><b>Typetag</b></i>></tt>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>Quantifier</b></i> <i><b>variable<sub>1</sub></b></i> . . . <i><b>variable<sub>n</sub></b></i> ( <i><b>body</b></i> )
</pre>
</td><td colspan="1" rowspan="1">
<pre><<i><b>Quantifier</b></i>>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>1</sub></b></i>)</declare>
. . .
<declare><tt>χ<sub>fld</sub></tt>(<i><b>variable<sub>n</sub></b></i>)</declare>
<formula><tt>χ<sub>fld</sub></tt>(<i><b>body</b></i>)</formula>
</<i><b>Quantifier</b></i>>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>Negation</b></i> <i><b>e</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><<i><b>Negation</b></i>>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<tt>χ<sub>fld</sub></tt>(<i><b>e</b></i>)
</<i><b>Negation</b></i>>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>pred</b></i> (
<i><b>argument<sub>1</sub></b></i>
. . .
<i><b>argument<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Atom>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<op><tt>χ<sub>fld</sub></tt>(<i><b>pred</b></i>)</op>
<args ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>n</sub></b></i>)
</args>
</Atom>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>func</b></i> (
<i><b>argument<sub>1</sub></b></i>
. . .
<i><b>argument<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Expr>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<op><tt>χ<sub>fld</sub></tt>(<i><b>func</b></i>)</op>
<args ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>argument<sub>n</sub></b></i>)
</args>
</Expr>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
List (
<i><b>element<sub>1</sub></b></i>
. . .
<i><b>element<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><List>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<items ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>n</sub></b></i>)
</items>
</List>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
List (
<i><b>element<sub>1</sub></b></i>
. . .
<i><b>element<sub>n</sub></b></i>
|
<i><b>remainder</b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><List>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<items ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>1</sub></b></i>)
. . .
<tt>χ<sub>fld</sub></tt>(<i><b>element<sub>n</sub></b></i>)
</items>
<rest><tt>χ<sub>fld</sub></tt>(<i><b>remainder</b></i>)</rest>
</List>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>pred</b></i> (
<i><b>name<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>name<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Atom>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<op><tt>χ<sub>fld</sub></tt>(<i><b>pred</b></i>)</op>
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>n</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Atom>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>func</b></i> (
<i><b>name<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>name<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
)
</pre>
</td><td colspan="1" rowspan="1">
<pre><Expr>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<op><tt>χ<sub>fld</sub></tt>(<i><b>func</b></i>)</op>
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<Name><tt>χ<sub>bld</sub></tt>(<i><b>name<sub>n</sub></b></i>)</Name>
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Expr>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>inst</b></i> [
<i><b>key<sub>1</sub></b></i> -> <i><b>filler<sub>1</sub></b></i>
. . .
<i><b>key<sub>n</sub></b></i> -> <i><b>filler<sub>n</sub></b></i>
]
</pre>
</td><td colspan="1" rowspan="1">
<pre><Frame>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<object><tt>χ<sub>fld</sub></tt>(<i><b>inst</b></i>)</object>
<slot ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>key<sub>1</sub></b></i>)
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>1</sub></b></i>)
</slot>
. . .
<slot ordered="yes">
<tt>χ<sub>fld</sub></tt>(<i><b>key<sub>n</sub></b></i>)
<tt>χ<sub>fld</sub></tt>(<i><b>filler<sub>n</sub></b></i>)
</slot>
</Frame>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>e<sub>1</sub></b></i> <b>$</b> <i><b>e<sub>2</sub></b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><<i><b>Binop</b></i>>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<i><b>e<sub>1</sub>'</b></i> <i><b>e<sub>2</sub>'</b></i>
</<i><b>Binop</b></i>>
<tt>where <i><b>Binop</b></i>, <i><b>e<sub>1</sub>'</b></i>, <i><b>e<sub>2</sub>'</b></i> are defined by the equation</tt>
<tt>χ<sub>fld</sub></tt><tt>(<i><b>e<sub>1</sub></b></i> <b>$</b> <i><b>e<sub>2</sub></b></i>) = <<i><b>Binop</b></i>><i><b>e<sub>1</sub>'</b></i> <i><b>e<sub>2</sub>'</b></i></<i><b>Binop</b></i>></tt>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
<i><b>unicodestring</b></i>^^<i><b>symspace</b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Const type="<i><b>symspace</b></i>">
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<i><b>unicodestring</b></i>
</Const>
</pre>
</td></tr>
<tr>
<td colspan="1" rowspan="1">
<pre>(* <i><b>const?</b></i> <i><b>frameconj?</b></i> *)
?<i><b>name<sub>1</sub></b></i>
</pre>
</td><td colspan="1" rowspan="1">
<pre><Var>
<id><tt>χ<sub>fld</sub></tt>(<i><b>const</b></i>)</id><i><b>?</b></i>
<meta><tt>χ<sub>fld</sub></tt>(<i><b>frameconj</b></i>)</meta><i><b>?</b></i>
<tt>χ<sub>bld</sub></tt>(<i><b>name<sub>1</sub></b></i>)
</Var>
</pre>
</td></tr></table>
<p><br />
<span class="anchor" id="sec-conformance"></span>
</p>
<a id="Conformance_of_RIF_Processors_with_RIF_Dialects" name="Conformance_of_RIF_Processors_with_RIF_Dialects"></a><h2> <span class="mw-headline">5 Conformance of RIF Processors with RIF Dialects </span></h2>
<p>RIF does not require or expect conformant systems to implement the
presentation syntax of a RIF dialect. Instead, conformance is described in terms of semantics-preserving transformations between the native syntax of a compliant system and the XML syntax of RIF-BLD.
</p><p>Let Τ be a set of datatypes and symbol spaces that includes the datatypes specified in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>] and the symbol spaces <tt>rif:iri</tt> and <tt>rif:local</tt>. Suppose also that Ε is a <a href="#def-fld-external-schema-set" title="">coherent set of external schemas</a> that includes the built-ins listed in [<a href="#ref-rif-dtb" title="">RIF-DTB</a>]. Let <i>D</i> be a RIF dialect (e.g., [<a href="#ref-rif-bld" title="">RIF-BLD</a>]). We say that a formula φ is a <i>D</i><sub>Τ,Ε</sub> formula iff
</p>
<ul>
<li>
it is a formula in the dialect <i>D</i>,
</li>
<li>
all datatypes and symbol spaces used in φ are in Τ, and
</li>
<li>
all externally defined terms used in φ are instantiations of some external schemas in Ε.
</li>
</ul>
<p><span class="anchor" id="def-conformance"></span>
A RIF processor is a <i><b>conformant</b></i> <i>D</i><sub>Τ,Ε</sub> <i><b>consumer</b></i> iff <i>it implements</i> a semantics-preserving mapping, μ, from the set of all <i>D</i><sub>Τ,Ε</sub> formulas to the language <i>L</i> of the processor.
</p><p>Formally, this means that for any pair φ, ψ of <i>D</i><sub>Τ,Ε</sub> formulas for which φ |=<sub><tt><i>D</i></tt></sub> ψ is defined, φ |=<sub><tt><i>D</i></tt></sub> ψ iff μ(φ) |=<sub><tt><i>L</i></tt></sub> μ(ψ). Here |=<sub><tt><i>D</i></tt></sub> denotes the logical entailment in the RIF dialect <i>D</i> and |=<sub><tt><i>L</i></tt></sub> is the logical entailment in the language <i>L</i> of the RIF processor.
</p><p>A RIF processor is a <i><b>conformant</b></i> <i>D</i><sub>Τ,Ε</sub> <i><b>producer</b></i> iff it implements a semantics-preserving mapping, ν, from the language <i>L</i> of the processor to the set of all <i>D</i><sub>Τ,Ε</sub> formulas.
</p><p>Formally, this means that for any pair φ, ψ of formulas in <i>L</i> for which φ |=<sub><tt><i>L</i></tt></sub> ψ is defined, φ |=<sub><tt><i>L</i></tt></sub> ψ iff ν(φ) |=<sub><tt><i>D</i></tt></sub> ν(ψ).
</p><p><br />
An <i><b>admissible document</b></i> in a logic RIF dialect <i>D</i> is one which conforms to all the syntactic constraints of <i>D</i>, including the ones that cannot be checked by an XML Schema validator (see Definition <a href="#def-fld-admissible-xml" title="">Admissible XML document in a logic dialect</a>).
</p>
<a id="References" name="References"></a><h2> <span class="mw-headline">6 References </span></h2>
<a id="Normative_References" name="Normative_References"></a><h3> <span class="mw-headline">6.1 Normative References </span></h3>
<p><span id="ref-owl-reference"></span>
</p>
<dl><dt> [OWL-Reference]
</dt><dd> <i><a class="external text" href="http://www.w3.org/TR/2004/REC-owl-ref-20040210/" title="http://www.w3.org/TR/2004/REC-owl-ref-20040210/">OWL Web Ontology Language Reference</a></i>, M. Dean, G. Schreiber, Editors, W3C Recommendation, 10 February 2004. Latest version available at <a class="external free" href="http://www.w3.org/TR/owl-ref/" title="http://www.w3.org/TR/owl-ref/">http://www.w3.org/TR/owl-ref/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-concepts"></span>
</p>
<dl><dt> [RDF-CONCEPTS]
</dt><dd> <i>Resource Description Framework (RDF): Concepts and Abstract Syntax</i>, Klyne G., Carroll J. (Editors), W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/">http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-concepts/" title="http://www.w3.org/TR/rdf-concepts/">http://www.w3.org/TR/rdf-concepts/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-semantics"></span>
</p>
<dl><dt> [RDF-SEMANTICS]
</dt><dd> <i>RDF Semantics</i>, Patrick Hayes, Editor, W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/">http://www.w3.org/TR/2004/REC-rdf-mt-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-mt/" title="http://www.w3.org/TR/rdf-mt/">http://www.w3.org/TR/rdf-mt/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rdf-schema"></span>
</p>
<dl><dt> [RDF-SCHEMA]
</dt><dd> <i>RDF Vocabulary Description Language 1.0: RDF Schema</i>, Brian McBride, Editor, W3C Recommendation 10 February 2004, <a class="external free" href="http://www.w3.org/TR/rdf-schema/" title="http://www.w3.org/TR/rdf-schema/">http://www.w3.org/TR/rdf-schema/</a>.
</dd></dl>
<p><span class="anchor" id="ref-rfc-3066"></span>
</p>
<dl><dt> [RFC-3066]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3066" title="http://tools.ietf.org/html/rfc3066">RFC 3066</a> - Tags for the Identification of Languages</i>, H. Alvestrand, IETF, January 2001. This document is at <a class="external free" href="http://www.ietf.org/rfc/rfc3066" title="http://www.ietf.org/rfc/rfc3066">http://www.ietf.org/rfc/rfc3066</a>.
</dd></dl>
<p><span class="anchor" id="ref-rfc-3987"></span>
</p>
<dl><dt> [RFC-3987]
</dt><dd> <i><a class="external" href="http://tools.ietf.org/html/rfc3987" title="http://tools.ietf.org/html/rfc3987">RFC 3987</a> - Internationalized Resource Identifiers (IRIs)</i>, M. Duerst and M. Suignard, IETF, January 2005. This document is at <a class="external free" href="http://www.ietf.org/rfc/rfc3987.txt" title="http://www.ietf.org/rfc/rfc3987.txt">http://www.ietf.org/rfc/rfc3987.txt</a>.
</dd></dl>
<p><span class="anchor" id="ref-rif-bld"></span>
</p>
<dl><dt> [RIF-BLD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/"><span>RIF Basic Logic Dialect</span></a></cite> Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-bld-20100622/">http://www.w3.org/TR/2010/REC-rif-bld-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-bld/">http://www.w3.org/TR/rif-bld/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-core"></span>
</p>
<dl><dt> [RIF-Core]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/"><span>RIF Core Dialect</span></a></cite> Harold Boley, Gary Hallmark, Michael Kifer, Adrian Paschke, Axel Polleres, Dave Reynolds, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-core-20100622/">http://www.w3.org/TR/2010/REC-rif-core-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-core/">http://www.w3.org/TR/rif-core/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-dtb"></span>
</p>
<dl><dt> [RIF-DTB]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/"><span>RIF Datatypes and Built-Ins 1.0</span></a></cite> Axel Polleres, Harold Boley, Michael Kifer, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-dtb-20100622/">http://www.w3.org/TR/2010/REC-rif-dtb-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-dtb/">http://www.w3.org/TR/rif-dtb/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-prd"></span>
</p>
<dl><dt> [RIF-PRD]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/"><span>RIF Production Rule Dialect</span></a></cite> Christian de Sainte Marie, Gary Hallmark, Adrian Paschke, eds. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-prd-20100622/">http://www.w3.org/TR/2010/REC-rif-prd-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-prd/">http://www.w3.org/TR/rif-prd/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-rif-swc"></span>
</p>
<dl><dt> [RIF-RDF+OWL]
</dt><dd><span><cite><a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/"><span>RIF RDF and OWL Compatibility</span></a></cite> Jos de Bruijn, editor. W3C Recommendation, 22 June 2010, <a href="http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/">http://www.w3.org/TR/2010/REC-rif-rdf-owl-20100622/</a>. Latest version available at <a href="http://www.w3.org/TR/rif-rdf-owl/">http://www.w3.org/TR/rif-rdf-owl/</a>.</span></dd></dl>
<p><span class="anchor" id="ref-xml-1-point-0"></span>
</p>
<dl><dt> [XML1.0]
</dt><dd> <i>Extensible Markup Language (XML) 1.0 (Fourth Edition)</i>, W3C Recommendation, World Wide Web Consortium, 16 August 2006, edited in place 29 September 2006. This version is <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-20060816/" title="http://www.w3.org/TR/2006/REC-xml-20060816/">http://www.w3.org/TR/2006/REC-xml-20060816/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xml-base"></span>
</p>
<dl><dt> [XML-Base]
</dt><dd> <i>XML Base</i>, W3C Recommendation, World Wide Web Consortium, 27 June 2001. This version is <a class="external free" href="http://www.w3.org/TR/2001/REC-xmlbase-20010627/" title="http://www.w3.org/TR/2001/REC-xmlbase-20010627/">http://www.w3.org/TR/2001/REC-xmlbase-20010627/</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xmlbase/" title="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>.
</dd></dl>
<p><span class="anchor" id="ref-xml-names"></span>
</p>
<dl><dt> [XML-Names]
</dt><dd> <i>Namespaces in XML 1.1 (Second Edition)</i>, W3C Recommendation, World Wide Web Consortium, 16 August 2006. This version is <a class="external free" href="http://www.w3.org/TR/2006/REC-xml-names11-20060816" title="http://www.w3.org/TR/2006/REC-xml-names11-20060816">http://www.w3.org/TR/2006/REC-xml-names11-20060816</a>. The latest version is available at <a class="external free" href="http://www.w3.org/TR/xml-names11/" title="http://www.w3.org/TR/xml-names11/">http://www.w3.org/TR/xml-names11/</a>.
</dd></dl>
<a id="Informational_References" name="Informational_References"></a><h3> <span class="mw-headline">6.2 Informational References </span></h3>
<p><span class="anchor" id="ref-alternating-normal-form"></span>
</p>
<dl><dt> [ANF01]
</dt><dd> <i>Normal Form Conventions for XML Representations of Structured Data</i>, Henry S. Thompson. October 2001. Available at <a class="external free" href="http://www.ltg.ed.ac.uk/~ht/normalForms.html" title="http://www.ltg.ed.ac.uk/~ht/normalForms.html">http://www.ltg.ed.ac.uk/~ht/normalForms.html</a>.
</dd></dl>
<p><span class="anchor" id="ref-strong-explicit-negation"></span>
</p>
<dl><dt> [APP96]
</dt><dd> <i>Strong and Explicit Negation in Non-Monotonic Reasoning and Logic Programming</i>, J.J. Alferes, L.M. Pereira, and T.C. Przymusinski. Lecture Notes In Computer Science, vol. 1126. Proceedings of the European Workshop on Logics in Artificial Intelligence, 1996.
</dd></dl>
<p><span class="anchor" id="ref-negation-as-failure"></span>
</p>
<dl><dt> [Clark87]
</dt><dd> <i>Negation as failure</i>, K. Clark. Readings in nonmonotonic reasoning, Morgan Kaufmann Publishers, pages 311 - 325, 1987. (Originally published in 1978.)
</dd></dl>
<p><span class="anchor" id="ref-sorted-hilog-93"></span>
</p>
<dl><dt> [CK95]
</dt><dd> <i>Sorted HiLog: Sorts in Higher-Order Logic Data Languages,</i> W. Chen, M. Kifer. Sixth Intl. Conference on Database Theory, Prague, Czech Republic, January 1995, Lecture Notes in Computer Science 893, Springer Verlag, pp. 252--265.
</dd></dl>
<p><span class="anchor" id="ref-hilog-93"></span>
</p>
<dl><dt> [CKW93]
</dt><dd> <i>HiLog: A Foundation for higher-order logic programming,</i> W. Chen, M. Kifer, D.S. Warren. Journal of Logic Programming, vol. 15, no. 3, February 1993, pp. 187--230.
</dd></dl>
<p><span class="anchor" id="ref-chang-lee"></span>
</p>
<dl><dt> [CL73]
</dt><dd> <i>Symbolic Logic and Mechanical Theorem Proving</i>, C.L. Chang and R.C.T. Lee. Academic Press, 1973.
</dd></dl>
<p><span class="anchor" id="ref-curie"></span>
</p>
<dl><dt> [CURIE]
</dt><dd> <i>CURIE Syntax 1.0: A syntax for expressing Compact URIs</i>, Mark Birbeck, Shane McCarron. W3C Candidate Recommendation 16 January 2009. Available at <a class="external free" href="http://www.w3.org/TR/curie/" title="http://www.w3.org/TR/curie/">http://www.w3.org/TR/curie/</a>.
</dd></dl>
<p><span class="anchor" id="ref-cycl"></span>
</p>
<dl><dt> [CycL]
</dt><dd> <i>The Syntax of CycL</i>, Web site. Available at <a class="external free" href="http://www.cyc.com/cycdoc/ref/cycl-syntax.html" title="http://www.cyc.com/cycdoc/ref/cycl-syntax.html">http://www.cyc.com/cycdoc/ref/cycl-syntax.html</a>.
</dd></dl>
<p><span class="anchor" id="ref-enderton01"></span>
</p>
<dl><dt> [Enderton01]
</dt><dd> <i>A Mathematical Introduction to Logic, Second Edition</i>, H. B. Enderton. Academic Press, 2001.
</dd></dl>
<p><span class="anchor" id="ref-fitting02"></span>
</p>
<dl><dt> [Fit02]
</dt><dd> <i>Fixpoint semantics for logic programming a survey</i>, M. Fitting. Theoretical Computer Science, vol. 278, no. 1-2, pp. 25-51, 2002.
</dd></dl>
<p><span class="anchor" id="ref-flora2"></span>
</p>
<dl><dt> [FL2]
</dt><dd> <i>FLORA-2: An Object-Oriented Knowledge Base Language</i>, M. Kifer. Web site. Available at <a class="external free" href="http://flora.sourceforge.net" title="http://flora.sourceforge.net">http://flora.sourceforge.net</a>.
</dd></dl>
<p><span class="anchor" id="ref-stable-model"></span>
</p>
<dl><dt> [GL88]
</dt><dd> <i>The Stable Model Semantics for Logic Programming</i>, M. Gelfond and V. Lifschitz. Logic Programming: Proceedings of the Fifth Conference and Symposium, pages 1070-1080, 1988.
</dd></dl>
<p><span class="anchor" id="ref-ASP-91"></span>
</p>
<dl><dt> [GL91]
</dt><dd> <i>Classical Negation in Logic Programs and Disjunctive Databases</i>, M. Gelfond and V. Lifschitz. New Generation Computing 9, pages 365-386, 1991.
</dd></dl>
<p><span class="anchor" id="ref-gelfond-leone"></span>
</p>
<dl><dt> [GLe02]
</dt><dd> <i>Logic programming and knowledge representation - The A-Prolog perspective,</i> M. Gelfond and N. Leone. Artificial Intelligence 138(1-2), pages 3-38, 2002.
</dd></dl>
<p><span class="anchor" id="ref-wf-model"></span>
</p>
<dl><dt> [GRS91]
</dt><dd> <i>The Well-Founded Semantics for General Logic Programs</i>, A. Van Gelder, K.A. Ross, J.S. Schlipf. Journal of ACM, 38:3, pages 620-650, 1991.
</dd></dl>
<p><span class="anchor" id="ref-flogic-95"></span>
</p>
<dl><dt> [KLW95]
</dt><dd> <i>Logical foundations of object-oriented and frame-based languages,</i> M. Kifer, G. Lausen, J. Wu. Journal of ACM, July 1995, pp. 741--843.
</dd></dl>
<p><span class="anchor" id="ref-lloyd-87"></span>
</p>
<dl><dt> [Lloyd87]
</dt><dd> <i>Foundations of Logic Programming (Second Edition),</i> J.W. Lloyd, Springer-Verlag, 1987.
</dd></dl>
<p><span class="anchor" id="ref-mendelson97"></span>
</p>
<dl><dt> [Mendelson97]
</dt><dd> <i>Introduction to Mathematical Logic, Fourth Edition</i>, E. Mendelson. Chapman & Hall, 1997.
</dd></dl>
<p><span class="anchor" id="ref-nxbre"></span>
</p>
<dl><dt> [NxBRE]
</dt><dd> <i>.NET Business Rule Engine</i>, Web site. Available at <a class="external free" href="http://nxbre.wiki.sourceforge.net/" title="http://nxbre.wiki.sourceforge.net/">http://nxbre.wiki.sourceforge.net/</a>.
</dd></dl>
<p><span class="anchor" id="ref-oojdrew"></span>
</p>
<dl><dt> [OOjD]
</dt><dd> <i>Object-Oriented jDREW</i>, Web site. Available at <a class="external free" href="http://www.jdrew.org/oojdrew/" title="http://www.jdrew.org/oojdrew/">http://www.jdrew.org/oojdrew/</a>.
</dd></dl>
<p><span class="anchor" id="ref-przymusinski-stationary"> </span>
</p>
<dl><dt> [Prz94]
</dt><dd> <i>Well-founded and stationary models of logic programs,</i> T.C. Przymusinski. Annals of Mathematics and Artificial Intelligence 12 (1994), pp. 141-187.
</dd></dl>
<p><span class="anchor" id="ref-rdf-syntax"></span>
</p>
<dl><dt> [RDFSYN04]
</dt><dd> <i>RDF/XML Syntax Specification (Revised)</i>, Dave Beckett, Editor, W3C Recommendation, 10 February 2004, <a class="external free" href="http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/" title="http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/">http://www.w3.org/TR/2004/REC-rdf-syntax-grammar-20040210/</a>. Latest version available at <a class="external free" href="http://www.w3.org/TR/rdf-syntax-grammar/" title="http://www.w3.org/TR/rdf-syntax-grammar/">http://www.w3.org/TR/rdf-syntax-grammar/</a>.
</dd></dl>
<p><span class="anchor" id="ref-relfun-99"></span>
</p>
<dl><dt> [RF99]
</dt><dd> <i>A Tight, Practical Integration of Relations and Functions</i>, H. Boley, Springer-Verlag, 1999.
</dd></dl>
<p><span class="anchor" id="ref-shoham-87"></span>
</p>
<dl><dt> [Shoham87]
</dt><dd> <i>Nonmonotonic logics: meaning and utility</i>, Y. Shoham. Proc. 10th International Joint Conference on Artificial Intelligence, Morgan Kaufmann, pp. 388--393, 1987.
</dd></dl>
<p><span class="anchor" id="ref-steele90"></span>
</p>
<dl><dt> [Steele90]
</dt><dd> <i>Common LISP: The Language, Second Edition</i>, G. L. Steele Jr. Digital Press, 1990.
</dd></dl>
<p><span class="anchor" id="ref-swsl-rules"></span>
</p>
<dl><dt> [SWSL-Rules]
</dt><dd> <i>Semantic Web Services Language (SWSL)</i>, S. Battle, A. Bernstein, H. Boley, B. Grosof, M. Gruninger, R. Hull, M. Kifer, D. Martin, S. McIlraith, D. McGuinness, J. Su, S. Tabet. W3C Member Submission, September 2005. Available at <a class="external free" href="http://www.w3.org/Submission/SWSF-SWSL/" title="http://www.w3.org/Submission/SWSF-SWSL/">http://www.w3.org/Submission/SWSF-SWSL/</a>.
</dd></dl>
<p><span class="anchor" id="ref-type-and-role-tags"></span>
</p>
<dl><dt> [TRT03]
</dt><dd> <i>Object-Oriented RuleML: User-Level Roles, URI-Grounded Clauses, and Order-Sorted Terms</i>, H. Boley. Springer LNCS 2876, Oct. 2003, pp. 1-16. Preprint at <a class="external free" href="http://iit-iti.nrc-cnrc.gc.ca/publications/nrc-46502_e.html" title="http://iit-iti.nrc-cnrc.gc.ca/publications/nrc-46502_e.html">http://iit-iti.nrc-cnrc.gc.ca/publications/nrc-46502_e.html</a>.
</dd></dl>
<p><span class="anchor" id="ref-vanemden-kowalski"></span>
</p>
<dl><dt> [vEK76]
</dt><dd> <i>The semantics of predicate logic as a programming language</i>, M. van Emden and R. Kowalski. Journal of the ACM 23 (1976), 733-742.
</dd></dl>
<p><span class="anchor" id="ref-wsml-rules"></span>
</p>
<dl><dt> [WSML-Rules]
</dt><dd> <i>Web Service Modeling Language (WSML)</i>, J. de Bruijn, D. Fensel, U. Keller, M. Kifer, H. Lausen, R. Krummenacher, A. Polleres, L. Predoiu. W3C Member Submission, June 2005. Available at <a class="external free" href="http://www.w3.org/Submission/WSML/" title="http://www.w3.org/Submission/WSML/">http://www.w3.org/Submission/WSML/</a>.
</dd></dl>
<p><span class="anchor" id="sec-xsd-fld"></span>
</p>
<a id="Appendix:_XML_Schema_for_RIF-FLD" name="Appendix:_XML_Schema_for_RIF-FLD"></a><h2> <span class="mw-headline">7 Appendix: XML Schema for RIF-FLD </span></h2>
<div><div dir="ltr" lang="en">
<p>The <b>namespace</b> of RIF is "<a class="external free" href="http://www.w3.org/2007/rif" title="http://www.w3.org/2007/rif#">http://www.w3.org/2007/rif#</a>".
</p><p>XML schemas for the RIF-FLD language are defined below and are also
available at <a class="external free" href="http://www.w3.org/2010/rif-schema/fld" title="http://www.w3.org/2010/rif-schema/fld">http://www.w3.org/2010/rif-schema/fld</a> with additional examples.
For modularity, we define a <i>Baseline</i> schema and a <i>Skyline</i> schema.
Baseline is the schema module that provides the foundation up to <tt>FORMULA</tt>s without <tt>Implies</tt>.
Skyline provides the full schema by augmenting Baseline with the <tt>Implies</tt> <tt>FORMULA</tt> as well as with <tt>Group</tt> and <tt>Document</tt>.
</p><p><br />
</p>
<a id="Baseline_Schema_Module" name="Baseline_Schema_Module"></a><h3> <span class="mw-headline">7.1 Baseline Schema Module </span></h3>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns="http://www.w3.org/2007/rif#"
targetNamespace="http://www.w3.org/2007/rif#"
elementFormDefault="qualified"
version="Id: FLDBaseline.xsd, v. 1.5, 2010-05-08, hboley/dhirtle">
<xs:import namespace='http://www.w3.org/XML/1998/namespace'
schemaLocation='http://www.w3.org/2001/xml.xsd'/>
<xs:annotation>
<xs:documentation>
This is the Baseline module of FLD. It is the foundation of the full schema
defined through the Skyline module. The Baseline XML schema is based on the
following EBNF (compared to the full EBNF of RIF-FLD, Group and Document are
omitted, and 'Implies' is missing from the productions for FORMULA and TERMULA).
The nonterminals starting with NEW provide extensions points for FLD
(cf. Section 4 XML Serialization Framework).
FORMULA ::= IRIMETA? CONNECTIVE '(' FORMULA* ')' |
IRIMETA? QUANTIFIER '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? FORMULA '@' MODULEREF |
FORM
FORM ::= IRIMETA? (Var | ATOMIC |
'External' '(' ATOMIC LOCATOR? ')')
ATOMIC ::= Const | Atom | Equal | Member | Subclass | Frame
Atom ::= UNITERM
UNITERM ::= TERMULA '(' (TERMULA* | (Name '->' TERMULA)*) ')'
Equal ::= TERMULA '=' TERMULA
Member ::= TERMULA '#' TERMULA
Subclass ::= TERMULA '##' TERMULA
Frame ::= TERMULA '[' (TERMULA '->' TERMULA)* ']'
TERMULA ::= IRIMETA? CONNECTIVE '(' TERMULA* ')' |
IRIMETA? QUANTIFIER '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? TERMULA '@' MODULEREF |
TERM
TERM ::= IRIMETA? (Var | EXPRIC | List |
'External' '(' EXPRIC LOCATOR? ')' |
AGGREGATE | NEWTERM)
EXPRIC ::= Const | Expr | Equal | Member | Subclass | Frame
Expr ::= UNITERM
List ::= 'List' '(' TERM* ')' | 'List' '(' TERM+ '|' TERM ')'
AGGREGATE ::= AGGRFUNC '{' Var ('[' Var+ ']')? '|' FORMULA '}'
Const ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
MODULEREF ::= Var | Const | Expr
CONNECTIVE ::= 'And' | 'Or' | NEWCONNECTIVE
QUANTIFIER ::= ('Exists' | 'Forall' | NEWQUANTIFIER) Var*
AGGRFUNC ::= 'Min' | 'Max' | 'Sum' | 'Prod' | 'Avg' | 'Count' |
'Set' | 'Bag' | NEWAGGRFUNC
SYMSPACE ::= ANGLEBRACKIRI | CURIE
LOCATOR ::= ANGLEBRACKIRI
Var ::= '?' Name
Name ::= NCName | '"' UNICODESTRING '"'
IRIMETA ::= '(*' Const? (Frame | 'And' '(' Frame* ')')? '*)'
</xs:documentation>
</xs:annotation>
<xs:group name="FORMULA">
<!--
'Implies' omitted from Baseline schema, allowing its modular use
FORMULA ::= IRIMETA? CONNECTIVE '(' FORMULA* ')' |
IRIMETA? QUANTIFIER '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? FORMULA '@' MODULEREF
FORM
CONNECTIVE ::= 'And' | 'Or' | NEWCONNECTIVE
QUANTIFIER ::= ('Exists' | 'Forall' | NEWQUANTIFIER) Var*
rewritten as
FORMULA ::= IRIMETA? 'And' '(' FORMULA* ')' |
IRIMETA? 'Or' '(' FORMULA* ')' |
IRIMETA? 'NEWCONNECTIVE' '(' FORMULA* ')' |
IRIMETA? 'Exists' Var* '(' FORMULA ')' |
IRIMETA? 'Forall' Var* '(' FORMULA ')' |
IRIMETA? 'NEWQUANTIFIER' Var* '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? 'Remote' '(' FORMULA MODULEREF ')'
FORM
-->
<xs:choice>
<xs:element name="And" type="And-FORMULA.type"/>
<xs:element name="Or" type="Or-FORMULA.type"/>
<xs:element name="NEWCONNECTIVE" type="NEWCONNECTIVE-FORMULA.type"/>
<xs:element name="Exists" type="Exists-FORMULA.type"/>
<xs:element name="Forall" type="Forall-FORMULA.type"/>
<xs:element name="NEWQUANTIFIER" type="NEWQUANTIFIER-FORMULA.type"/>
<xs:element name="Neg" type="Neg-FORMULA.type"/>
<xs:element name="Naf" type="Naf-FORMULA.type"/>
<xs:element name="Remote" type="Remote-FORMULA.type"/>
<xs:group ref="FORM"/>
</xs:choice>
</xs:group>
<xs:complexType name="And-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="formula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Or-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="formula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NEWCONNECTIVE-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="formula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Exists-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="formula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Forall-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="formula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NEWQUANTIFIER-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="formula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Neg-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="formula" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Naf-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="formula" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Remote-FORMULA.type">
<!-- sensitive to FORMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="formula"/>
<xs:element ref="internal"/>
</xs:sequence>
</xs:complexType>
<xs:element name="internal">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERM"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="External-FORMULA.type">
<!-- sensitive to FORMULA (Atom | Frame) context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="content" type="content-FORMULA.type"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="content-FORMULA.type">
<!-- sensitive to FORMULA (Atom | Frame) context-->
<xs:sequence>
<xs:choice>
<xs:element ref="Atom"/>
<xs:element ref="Frame"/>
</xs:choice>
</xs:sequence>
</xs:complexType>
<xs:element name="formula">
<xs:complexType>
<xs:sequence>
<xs:group ref="FORMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="declare">
<xs:complexType>
<xs:sequence>
<xs:element ref="Var"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="FORM">
<!--
FORM ::= IRIMETA? (Var | ATOMIC |
'External' '(' ATOMIC LOCATOR? ')')
-->
<xs:choice>
<xs:element ref="Var"/>
<xs:group ref="ATOMIC"/>
<xs:element name="External" type="External-FORM.type"/>
</xs:choice>
</xs:group>
<xs:complexType name="External-FORM.type">
<!-- sensitive to FORM (ATOMIC) context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="content" type="content-FORM.type"/>
<xs:element ref="location" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="content-FORM.type">
<!-- sensitive to FORM (ATOMIC) context-->
<xs:sequence>
<xs:group ref="ATOMIC"/>
</xs:sequence>
</xs:complexType>
<xs:group name="ATOMIC">
<!--
ATOMIC ::= Const | Atom | Equal | Member | Subclass | Frame
-->
<xs:choice>
<xs:element ref="Const"/>
<xs:element ref="Atom"/>
<xs:element ref="Equal"/>
<xs:element ref="Member"/>
<xs:element ref="Subclass"/>
<xs:element ref="Frame"/>
</xs:choice>
</xs:group>
<xs:element name="Atom">
<!--
Atom ::= UNITERM
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="UNITERM"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="UNITERM">
<!--
UNITERM ::= TERMULA '(' (TERMULA* | (Name '->' TERMULA)*) ')'
-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="op"/>
<xs:choice>
<xs:element ref="args" minOccurs="0" maxOccurs="1"/>
<xs:element name="slot" type="slot-UNITERM.type" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:sequence>
</xs:group>
<xs:element name="op">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="args">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ordered" type="xs:string" fixed="yes"/>
</xs:complexType>
</xs:element>
<xs:complexType name="slot-UNITERM.type">
<!-- sensitive to UNITERM (Name) context-->
<xs:sequence>
<xs:element ref="Name"/>
<xs:group ref="TERMULA"/>
</xs:sequence>
<xs:attribute name="ordered" type="xs:string" fixed="yes"/>
</xs:complexType>
<xs:element name="Equal">
<!--
Equal ::= TERMULA '=' TERMULA
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="left"/>
<xs:element ref="right"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="left">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="right">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Member">
<!--
Member ::= TERMULA '#' TERMULA
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="instance"/>
<xs:element ref="class"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Subclass">
<!--
Subclass ::= TERMULA '##' TERMULA
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="sub"/>
<xs:element ref="super"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="instance">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="class">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sub">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="super">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Frame">
<!--
Frame ::= TERMULA '[' (TERMULA '->' TERMULA)* ']'
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="object"/>
<xs:element name="slot" type="slot-Frame.type" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="object">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="slot-Frame.type">
<!-- sensitive to Frame (TERMULA) context-->
<xs:sequence>
<xs:group ref="TERMULA"/>
<xs:group ref="TERMULA"/>
</xs:sequence>
<xs:attribute name="ordered" type="xs:string" fixed="yes"/>
</xs:complexType>
<xs:group name="TERMULA">
<!--
'Implies' omitted from Baseline schema, allowing its modular use
TERMULA ::= IRIMETA? CONNECTIVE '(' TERMULA* ')' |
IRIMETA? QUANTIFIER '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? TERMULA '@' MODULEREF |
TERM
CONNECTIVE ::= 'And' | 'Or' | NEWCONNECTIVE
QUANTIFIER ::= ('Exists' | 'Forall' | NEWQUANTIFIER) Var*
rewritten as
TERMULA ::= IRIMETA? 'And' '(' TERMULA* ')' |
IRIMETA? 'Or' '(' TERMULA* ')' |
IRIMETA? 'NEWCONNECTIVE' '(' TERMULA* ')' |
IRIMETA? 'Exists' Var* '(' TERMULA ')' |
IRIMETA? 'Forall' Var* '(' TERMULA ')' |
IRIMETA? 'NEWQUANTIFIER' Var* '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? 'Remote' '(' TERMULA MODULEREF ')'
TERM
-->
<xs:choice>
<xs:element name="And" type="And-TERMULA.type"/>
<xs:element name="Or" type="Or-TERMULA.type"/>
<xs:element name="NEWCONNECTIVE" type="NEWCONNECTIVE-TERMULA.type"/>
<xs:element name="Exists" type="Exists-TERMULA.type"/>
<xs:element name="Forall" type="Forall-TERMULA.type"/>
<xs:element name="NEWQUANTIFIER" type="NEWQUANTIFIER-TERMULA.type"/>
<xs:element name="Neg" type="Neg-TERMULA.type"/>
<xs:element name="Naf" type="Naf-TERMULA.type"/>
<xs:element name="Remote" type="Remote-TERMULA.type"/>
<xs:group ref="TERM"/>
</xs:choice>
</xs:group>
<xs:complexType name="And-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="termula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Or-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="termula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NEWCONNECTIVE-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="termula" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Exists-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="termula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Forall-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="termula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NEWQUANTIFIER-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="termula"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Neg-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="termula" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Naf-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="termula" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Remote-TERMULA.type">
<!-- sensitive to TERMULA context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="termula"/>
<xs:element ref="internal"/>
</xs:sequence>
</xs:complexType>
<xs:element name="termula">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="TERM">
<!--
TERM ::= IRIMETA? (Var | EXPRIC | List |
'External' '(' EXPRIC LOCATOR? ')' |
AGGREGATE | NEWTERM)
-->
<xs:choice>
<xs:element ref="Var"/>
<xs:group ref="EXPRIC"/>
<xs:element ref="List"/>
<xs:element name="External" type="External-TERM.type"/>
<xs:element ref="AGGREGATE"/>
<xs:element ref="NEWTERM"/>
</xs:choice>
</xs:group>
<xs:element name="List">
<!--
List ::= 'List' '(' TERM* ')' | 'List' '(' TERM+ '|' TERM ')'
rewritten as
List ::= 'List' '(' LISTELEMENTS? ')'
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:group ref="LISTELEMENTS" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="LISTELEMENTS">
<!--
LISTELEMENTS ::= TERM+ ('|' TERM)?
-->
<xs:sequence>
<xs:element ref="items"/>
<xs:element ref="rest" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:group>
<xs:element name="items">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERM" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="ordered" type="xs:string" fixed="yes"/>
</xs:complexType>
</xs:element>
<xs:element name="rest">
<xs:complexType>
<xs:sequence>
<xs:group ref="TERM"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="External-TERM.type">
<!-- sensitive to TERM (EXPRIC) context-->
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element name="content" type="content-TERM.type"/>
<xs:element ref="location" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="content-TERM.type">
<!-- sensitive to TERM (EXPRIC) context-->
<xs:sequence>
<xs:group ref="EXPRIC"/>
</xs:sequence>
</xs:complexType>
<xs:group name="EXPRIC">
<!--
EXPRIC ::= Const | Expr | Equal | Member | Subclass | Frame
-->
<xs:choice>
<xs:element ref="Const"/>
<xs:element ref="Expr"/>
<xs:element ref="Equal"/>
<xs:element ref="Member"/>
<xs:element ref="Subclass"/>
<xs:element ref="Frame"/>
</xs:choice>
</xs:group>
<xs:element name="Expr">
<!--
Expr ::= UNITERM
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="UNITERM"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AGGREGATE" abstract="true">
<!--
AGGREGATE ::= AGGRFUNC '{' Var ('[' Var+ ']')? '|' FORMULA '}'
AGGRFUNC ::= 'Min' | 'Max' | 'Sum' | 'Prod' | 'Avg' | 'Count' |
'Set' | 'Bag' | NEWAGGRFUNC
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="declare" minOccurs="2" maxOccurs="unbounded"/>
<xs:element ref="formula"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Min" substitutionGroup="AGGREGATE"/>
<xs:element name="Max" substitutionGroup="AGGREGATE"/>
<xs:element name="Sum" substitutionGroup="AGGREGATE"/>
<xs:element name="Prod" substitutionGroup="AGGREGATE"/>
<xs:element name="Avg" substitutionGroup="AGGREGATE"/>
<xs:element name="Count" substitutionGroup="AGGREGATE"/>
<xs:element name="Set" substitutionGroup="AGGREGATE"/>
<xs:element name="Bag" substitutionGroup="AGGREGATE"/>
<xs:element name="NEWAGGRFUNC" substitutionGroup="AGGREGATE"/>
<xs:element name="NEWTERM">
<!--
This uses the XSD wildcard schema component, any, allowing a NEWTERM
to have zero or more child elements (role tags).
-->
<xs:complexType>
<xs:sequence>
<xs:any processContents="skip" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Const">
<!--
Const ::= '"' UNICODESTRING '"^^' SYMSPACE | CONSTSHORT
-->
<xs:complexType mixed="true">
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="type" type="xs:anyURI" use="required"/>
<xs:attribute ref="xml:lang"/>
</xs:complexType>
</xs:element>
<xs:element name="Name" type="xs:string">
<!--
Name ::= NCName | '"' UNICODESTRING '"'
... i.e., 'Name' stands for either the NCName string or the UNICODESTRING with the outer quotes stripped off.
-->
</xs:element>
<xs:element name="Var">
<!--
Var ::= '?' Name
-->
<xs:complexType mixed="true">
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="IRIMETA">
<!--
IRIMETA ::= '(*' Const? (Frame | 'And' '(' Frame* ')')? '*)'
-->
<xs:sequence>
<xs:element ref="id" minOccurs="0" maxOccurs="1"/>
<xs:element ref="meta" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:group>
<xs:element name="id">
<xs:complexType>
<xs:sequence>
<xs:element ref="Const"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="meta">
<xs:complexType>
<xs:choice>
<xs:element ref="Frame"/>
<xs:element name="And" type="And-meta.type"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:complexType name="And-meta.type">
<!-- sensitive to meta (Frame) context-->
<xs:sequence>
<xs:element name="formula" type="formula-meta.type" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="formula-meta.type">
<!-- sensitive to meta (Frame) context-->
<xs:sequence>
<xs:element ref="Frame"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="IRICONST.type" mixed="true">
<!-- sensitive to location/id context-->
<xs:sequence/>
<xs:attribute name="type" type="xs:anyURI" use="required" fixed="http://www.w3.org/2007/rif#iri"/>
</xs:complexType>
<xs:element name="location" type="xs:anyURI"/>
</xs:schema>
</pre>
<a id="Skyline_Schema_Module" name="Skyline_Schema_Module"></a><h3> <span class="mw-headline">7.2 Skyline Schema Module </span></h3>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns="http://www.w3.org/2007/rif#"
targetNamespace="http://www.w3.org/2007/rif#"
elementFormDefault="qualified"
version="Id: FLDSkyline.xsd, v. 1.5, 2010-02-02, hboley/dhirtle">
<xs:annotation>
<xs:documentation>
This is the Skyline schema module of FLD. It is split off from the Baseline
schema for modularity. The Skyline XML schema is based on the following EBNF
(which adds Group and Document, and brings 'Implies' into FORMULA and TERMULA):
Document ::= IRIMETA? 'Document' '(' Dialect? Base? Prefix* Import* Module* Group? ')'
Dialect ::= 'Dialect' '(' Name ')'
Base ::= 'Base' '(' ANGLEBRACKIRI ')'
Prefix ::= 'Prefix' '(' NCName ANGLEBRACKIRI ')'
Import ::= IRIMETA? 'Import' '(' LOCATOR PROFILE? ')'
Module ::= IRIMETA? 'Module' '(' (Const | Expr) LOCATOR ')'
Group ::= IRIMETA? 'Group' '(' (FORMULA | Group)* ')'
Implies ::= IRIMETA? FORMULA ':-' FORMULA
FORMULA ::= Implies |
IRIMETA? CONNECTIVE '(' FORMULA* ')' |
IRIMETA? QUANTIFIER '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? FORMULA '@' MODULEREF |
FORM
TERMULA ::= Implies |
IRIMETA? CONNECTIVE '(' TERMULA* ')' |
IRIMETA? QUANTIFIER '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? TERMULA '@' MODULEREF |
TERM
PROFILE ::= ANGLEBRACKIRI
Note that this is an extension of the syntax for the Baseline schema (FLDBaseline.xsd).
</xs:documentation>
</xs:annotation>
<!--
The Skyline schema extends, with Implies, the FORMULA and TERMULA groups
of the Baseline schema from the same directory
-->
<xs:redefine schemaLocation="FLDBaseline.xsd">
<!--
FORMULA ::= Implies |
IRIMETA? CONNECTIVE '(' FORMULA* ')' |
IRIMETA? QUANTIFIER '(' FORMULA ')' |
IRIMETA? 'Neg' FORMULA |
IRIMETA? 'Naf' FORMULA |
IRIMETA? FORMULA '@' MODULEREF |
FORM
TERMULA ::= Implies |
IRIMETA? CONNECTIVE '(' TERMULA* ')' |
IRIMETA? QUANTIFIER '(' TERMULA ')' |
IRIMETA? 'Neg' TERMULA |
IRIMETA? 'Naf' TERMULA |
IRIMETA? TERMULA '@' MODULEREF |
TERM
-->
<xs:group name="FORMULA">
<xs:choice>
<xs:group ref="FORMULA"/>
<xs:element ref="Implies"/>
</xs:choice>
</xs:group>
<xs:group name="TERMULA">
<xs:choice>
<xs:group ref="TERMULA"/>
<xs:element ref="Implies"/>
</xs:choice>
</xs:group>
</xs:redefine>
<xs:element name="Document">
<!--
Document ::= IRIMETA? 'Document' '(' Dialect? Base? Prefix* Import* Module* Group? ')'
Dialect ::= 'Dialect' '(' Name ')' represented with a dialect attribute.
Base and Prefix represented directly in XML.
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="directive" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="payload" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="dialect" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:element name="directive">
<xs:complexType>
<xs:choice>
<xs:element ref="DIRECTIVE-IMPORT"/>
<xs:element ref="DIRECTIVE-MODULE"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="DIRECTIVE-IMPORT">
<xs:complexType>
<xs:sequence>
<xs:element ref="Import"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DIRECTIVE-MODULE">
<xs:complexType>
<xs:sequence>
<xs:element ref="Module"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="payload">
<xs:complexType>
<xs:sequence>
<xs:element ref="Group"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Import">
<!--
Import ::= IRIMETA? 'Import' '(' LOCATOR PROFILE? ')'
LOCATOR ::= ANGLEBRACKIRI
PROFILE ::= ANGLEBRACKIRI
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="location"/>
<xs:element ref="profile" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Module">
<!--
Module ::= IRIMETA? 'Module' '(' (Const | Expr) LOCATOR ')'
LOCATOR ::= ANGLEBRACKIRI
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:choice>
<xs:element ref="Const"/>
<xs:element ref="Expr"/>
</xs:choice>
<xs:element ref="location"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="profile" type="xs:anyURI"/>
<xs:element name="Group">
<!--
Group ::= IRIMETA? 'Group' '(' (FORMULA | Group)* ')'
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="sentence" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sentence">
<xs:complexType>
<xs:choice>
<xs:group ref="FORMULA"/>
<xs:element ref="Group"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Implies">
<!--
Implies ::= IRIMETA? FORMULA ':-' FORMULA
-->
<xs:complexType>
<xs:sequence>
<xs:group ref="IRIMETA" minOccurs="0" maxOccurs="1"/>
<xs:element ref="if"/>
<xs:element ref="then"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="if">
<xs:complexType>
<xs:sequence>
<xs:group ref="FORMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="then">
<xs:complexType>
<xs:sequence>
<xs:group ref="FORMULA"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</pre>
<div id="changelog">
<p><br />
</p><p><br />
<span class="anchor" id="appendix-herbrand-structures"></span>
</p>
<a id="Appendix:_A_Subframework_for_Herbrand_Semantic_Structures" name="Appendix:_A_Subframework_for_Herbrand_Semantic_Structures"></a><h2> <span class="mw-headline">8 Appendix: A Subframework for Herbrand Semantic Structures </span></h2>
<p>The semantics of most languages in Logic Programming, including the well-founded semantics [<a href="#ref-wf-model" title="">GRS91</a>,<a href="#ref-przymusinski-stationary" title="">Prz94</a>] and the answer set (or stable model) semantics [<a href="#ref-stable-model" title="">GL88</a>,<a href="#ref-ASP-91" title="">GL91</a>,<a href="#ref-gelfond-leone" title="">GLe02</a>] are defined with respect to <i>Herbrand semantic structures</i> [<a href="#ref-chang-lee" title="">CL73</a>]. This appendix introduces the concepts of Herbrand Universe, Herbrand Structures, and related notions in the context of RIF-FLD in order to facilitate specializations of the RIF logical framework to logic programming dialects.
</p><p>A RIF-FLD semantic structure, <i><b>I</b></i> = <<i><b>TV</b></i>, <i><b>DTS</b></i>, <i><b>D</b></i>, <i><b>I</b></i><sub>C</sub>, <i><b>I</b></i><sub>V</sub>, <i><b>I</b></i><sub>F</sub>, <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>list</sub>, <i><b>I</b></i><sub>tail</sub>, <i><b>I</b></i><sub>frame</sub>, <i><b>I</b></i><sub>sub</sub>, <i><b>I</b></i><sub>isa</sub>, <i><b>I</b></i><sub>=</sub>, <i><b>I</b></i><sub>external</sub>, <i><b>I</b></i><sub>connective</sub>, <i><b>I</b></i><sub>truth</sub>>
is <i>Herbrand</i> if its domain, <i><b>D</b></i>, is Herbrand and the mappings <i><b>I</b></i><sub>C</sub>, <i><b>I</b></i><sub>V</sub>, <i><b>I</b></i><sub>F</sub>, <i><b>I</b></i><sub>NF</sub>, <i><b>I</b></i><sub>list</sub>, <i><b>I</b></i><sub>tail</sub>, <i><b>I</b></i><sub>frame</sub>, <i><b>I</b></i><sub>sub</sub>, <i><b>I</b></i><sub>isa</sub>, <i><b>I</b></i><sub>=</sub>, <i><b>I</b></i><sub>external</sub>, <i><b>I</b></i><sub>connective</sub>, <i><b>I</b></i><sub>truth</sub> satisfy certain conditions. The definitions, below, will make this statement precise.
</p><p>In what follows, we will be calling any variable-free term a <i><b>ground</b></i> term.
</p><p><br />
<span class="anchor" id="def-herbrand-domain"></span>
<b>Definition (Herbrand Universe and Domain).</b>
Given a <a href="#sec-fld-language" title="">language of RIF-FLD</a>,
a <i><b>Herbrand RIF-FLD universe</b></i>, <i><b>HU</b></i>, is a set consisting of all the ground <a href="#def-fld-well-formed-term" title="">well-formed terms</a> defined by RIF-FLD except the aggregate terms, external terms, and remote term references.
</p><p>Given a semantic structure <i><b>I</b></i>, as above, we say that it has a <i><b>Herbrand RIF-FLD domain</b></i> if <i><b>D</b></i> (its domain) is a factor <i><b>HU</b></i>/ <i>E</i>, i.e., the set of all equivalence classes, of the elements in <i><b>HU</b></i> with respect to an equivalence relation, <i>E</i>, which is defined as the minimal relation that satisfies the following condition:
</p>
<ul>
<li>
If <i>s,t</i> <tt>∈</tt> <i><b>HU</b></i> and <i>TVal<sub>I</sub></i>(<tt>s=t</tt>) = <b>t</b> then (<tt>s</tt>,<tt>t</tt>) <tt>∈</tt> <i>E</i>.
</li>
</ul>
<p>
We will use the symbol <i><b>HD</b></i> to denote Herbrand domains. ☐
</p>
<p>
Note that the general properties of <i>TVal<sub>I</sub></i> in semantic structures (Definition <a href="#def-fld-truth" title="">Truth valuation</a>) also imply that:
</p>
<ul>
<li>
If <i>s,t</i> <tt>∈</tt> <i><b>HU</b></i> are terms with named arguments that differ only in the order of the arguments then (<tt>s</tt>,<tt>t</tt>) <tt>∈</tt> <i>E</i>.
</li>
<li>
If <i>s,t</i> <tt>∈</tt> <i><b>HU</b></i> are frame terms that differ only in the order of their attribute/value pairs then (<tt>s</tt>,<tt>t</tt>) <tt>∈</tt> <i>E</i>.
</li>
</ul>
<p><span class="anchor" id="def-herbrand-semantic-structure"></span>
<b>Definition (Herbrand Semantic Structure).</b> A RIF-FLD semantic structure <i><b>I</b></i> of the above form is a <i><b>Herbrand RIF-FLD semantic structure</b></i> iff:
</p>
<ul>
<li>
It has a Herbrand RIF-FLD domain <i><b>HD</b></i>.
</li>
<li>
The <a href="#def-term-interpreting-map" title="">term-interpreting mapping</a> <i><b>I</b></i> is such that it maps every ground term in <i><b>HU</b></i> to its equivalence class in <i><b>HD</b></i>.
<p>
This mapping implicitly also defines the subdomains of <i><b>HD</b></i>, which correspond to the various signatures and are defined earlier -- see <a href="#the-effect-of-signatures" title="">the effect of signatures</a> on the semantics. Namely, for any signature <tt>sg</tt>, its subdomain <i><b>HD</b></i><sub><tt>sg</tt></sub> <tt>⊆</tt> <i><b>HD</b></i> is precisely the set {<i><b>I</b></i>(<tt>t</tt>)| <tt>t</tt> is a well-formed term that has <tt>sg</tt> as one of its signatures}.
</p>
</li>
</ul>
<p>RIF-FLD <a href="#def-fld-semantic-multistruct" title="">semantic multi-structures</a> that are built out of Herbrand RIF-FLD semantic structures will be called <i><b>Herbrand RIF-FLD semantic multi-structures</b></i>. ☐
</p><p>Logic programming dialects often use the following notion of <i>minimal</i> Herbrand RIF-FLD models.
</p><p><span class="anchor" id="def-minimal-model"></span>
<b>Definition (Minimal Model with Respect to the Truth Order).</b> Let <b>Γ</b> be a <i>ground</i> RIF-FLD document. A Herbrand RIF-FLD semantic multi-structure <i><b>Î</b></i> that is a model of <b>Γ</b> is said to be a <i><b>minimal model in the truth order</b></i> <<sub>t</sub> of <b>Γ</b> if there is no other Herbrand RIF-FLD model <i><b>Î'</b></i> of <b>Γ</b> such that:
</p>
<ul>
<li>
<i>TVal</i><sub>Î'</sub>(<tt>φ</tt>) = <b>t</b>
implies
<i>TVal</i><sub>Î</sub>(<tt>φ</tt>) = <b>t</b>
and
</li>
<li>
<i>TVal</i><sub>Î</sub>(<tt>φ</tt>) = <b>f</b>
implies
<i>TVal</i><sub>Î'</sub>(<tt>φ</tt>) = <b>f</b>
</li>
</ul>
<p>
for every formula <tt>φ</tt> of the form <tt>L</tt> or <tt>Neg L</tt>, where <tt>L</tt> is a ground atomic formula. Dialects may further specialize this notion by imposing additional restrictions. ☐
</p>
<p>Least semantic structures, defined below, are often used in the definitions of various fixpoint operators as starting points of the iteration process that computes the least fixpoint.
</p><p><span class="anchor" id="def-least-herb-struct"></span>
<b>Definition (Least Herbrand Structure with Respect to the Truth Order).</b> A Herbrand RIF-FLD semantic structure <i><b>I</b></i> is said to be the <i><b>least</b></i> in the truth order iff <i><b>I</b></i><sub>true</sub> maps every element of the Herbrand domain to <b>f</b> except for those elements that correspond to tautological formula terms (for example, <tt>And()</tt>) -- these are mapped to <b>t</b>. Dialects might have additional requirements. For example, some elements of the Herbrand domain might be "tautologically undefined," i.e., always mapped to <b>u</b>. ☐
</p><p>The standard definitions of the well-founded semantics typically employ so-called "empty" semantic structures -- structures where everything that <i>can</i> be undefined is undefined. The following definition adapts this concept to RIF-FLD. It applies to dialects that have a special undefinedness truth value <b>u</b> such that <b>f</b> <<sub>t</sub> <b>u</b> <<sub>t</sub> <b>t</b>. The usual general definition for <b>u</b> is that it is the smallest element in <i><b>TV</b></i> with respect to the <i>knowledge order</i> <<sub>k</sub> -- an order on the sets of truth values, which is sometimes used in addition to the truth order [<a href="#ref-fitting02" title="">Fit02</a>]. In many cases, however, the mention of <<sub>k</sub> is omitted as, for example, in the case of the well-founded semantics (where it is implicitly assumed that <b>u</b> <<sub>k</sub> <b>f</b> and <b>u</b> <<sub>k</sub> <b>t</b>) and in the case of stable models (where <<sub>k</sub> is an empty relation).
</p><p><span class="anchor" id="def-empty-herb-struct"></span>
<b>Definition (Empty Herbrand Structure).</b> Let <i><b>I</b></i> be a Herbrand RIF-FLD semantic structure with the set of truth values <i><b>TV</b></i> that has a special undefinedness truth value <b>u</b> such that <b>f</b> <<sub>t</sub> <b>u</b> <<sub>t</sub> <b>t</b>. Then <i><b>I</b></i> is said to be <i><b>empty</b></i> iff <i><b>I</b></i><sub>true</sub> maps everything to <b>u</b> except for the elements of the Herbrand domain that correspond to tautological formula terms (for example, <tt>And()</tt>), which are mapped to <b>t</b>; and elements of the domain that correspond to unsatisfiable formulas (e.g., <tt>Or()</tt>), which are maped to <b>f</b>. Dialects may have additional requirements. For example, some elements of the Herbrand domain might always have some other truth values specific to the particular dialects. ☐
</p><p><br />
The above concepts were defined exclusively of ground RIF-FLD documents, but practically interesting RIF documents are usually non-ground. A typical mechanism by which non-ground documents are reduced to the ground ones is called <i>ground instantiation</i>. It applies only to <i>universal</i> RIF-FLD documents.
</p><p><span class="anchor" id="def-universal-document"></span>
<b>Definition (Universal RIF-FLD Document).</b>
A RIF-FLD document is <i><b>universal</b></i> if it has the form <tt>Document(<em>directive<sub>1</sub></em> ... <em>directive<sub>n</sub></em> Γ)</tt> or <tt>Document(<em>directive<sub>1</sub></em> ... <em>directive<sub>n</sub></em>)</tt>. In the former case, when the group formula <tt>Γ</tt> is present, <tt>Γ</tt> must be a <i>universal formula</i>.
</p><p>A non-group, non-document formula is <i><b>universal</b></i> if it has the form <tt>Forall ?V<sub>1</sub> ... ?V<sub>n</sub>(η)</tt>, where <tt>η</tt> has no quantifiers and all of its variables are among <tt>?V<sub>1</sub> ... ?V<sub>n</sub></tt>. A group formula <tt>Group(φ<sub>1</sub> ... φ<sub>n</sub>)</tt> is <i><b>universal</b></i> if either <tt>n=0</tt> (i.e., it is an empty group formula) or each <tt>φ<sub>i</sub></tt> is universal.
☐
</p><p>Ground instantiations are now defined as follows.
</p><p><span class="anchor" id="def-ground-instantiation"></span>
<b>Definition (Ground Instantiations).</b> Let <b>Γ</b> be a <a href="#def-universal-document" title="">universal RIF-FLD document</a>. Its <i><b>ground instantiation</b></i> is a set of RIF-FLD documents obtained from <b>Γ</b> by replacing every RIF-FLD non-group formula in <b>Γ</b> that is a direct subformula of a group formula with the set of all their <i>ground instances</i>.
</p><p>A universal formula <tt>φ</tt> is said to be a <i><b>ground instance</b></i> of another formula, <tt>ψ</tt>, if and only if <tt>φ</tt> is obtained from <tt>ψ</tt> by a <i>coherent</i> replacement of variables with ground terms in <i><b>HU</b></i>. Coherence here means that, while constructing <tt>φ</tt> from <tt>ψ</tt>, the same variables are always substituted with the same terms. (Note: <i><b>I</b></i><sub>V</sub>(<tt>ψ</tt>) is a ground instance of <tt>ψ</tt>, but there can be many others, since variables can be mapped to arbitrary ground terms in <i><b>HU</b></i>.) ☐
</p><p><br />
Note that according to the definition of the <a href="#def-fld-truth" title="">truth valuation</a>, <i>TVal</i><sub>I</sub>(<tt>φ</tt>) = ~<i>TVal</i><sub>I</sub>(<tt>Naf φ</tt>), i.e., when <tt>φ</tt> is true then <tt>Naf φ</tt> is false, and vice versa (and, for example, when one is undefined in three-valued semantics then so is the other). However, RIF-FLD imposes no constraints on <tt>Neg φ</tt>. Many logic programming theories require <i>consistency</i> of the Herbrand models, and the following definition is provided for the use by the corresponding dialects. However, the definitions in this section do not rely on this consistency assumption.
</p><p><span class="anchor" id="def-consistent-semantic-structure"></span>
<b>Definition (Consistent Semantic Structure).</b> A Herbrand RIF-FLD semantic structure <i><b>I</b></i> is said to be <i><b>consistent</b></i> if <i>TVal</i><sub>I</sub>(<tt>φ</tt>) and <i>TVal</i><sub>I</sub>(<tt>Neg φ</tt>) are not both <b>t</b> (which is equivalent to saying that <i><b>I</b></i><sub>true</sub>(<i><b>I</b></i>(<tt>φ</tt>)) and <i><b>I</b></i><sub>true</sub>(<i><b>I</b></i>(<tt>Neg φ</tt>)) are not both <b>t</b>). However, they can both be <b>f</b> (or, for example, <b>u</b>, in three-valued dialects). A semantic multi-structure is consistent if all its component semantic structures are consistent. ☐
</p>
<a id="Appendix:_Change_Log_.28Informative.29" name="Appendix:_Change_Log_.28Informative.29"></a><h2> <span class="mw-headline">9 Appendix: Change Log (Informative) </span></h2>
<p>This appendix summarizes the main changes to this document.
</p><p>Changes since the <a class="external text" href="http://www.w3.org/TR/2009/WD-rif-fld-20090703/" title="http://www.w3.org/TR/2009/WD-rif-fld-20090703/">draft of July 3, 2009</a>.
</p>
<ul><li> "All RIF dialects are expected to support certain symbols spaces" was added.
</li><li> "instance" of an external schema was replaced with "instantiation" of an external schema.
</li><li> More examples were added; some examples were better explained.
</li><li> IRICONST was replaced with ANYURICONST in FLDSkyline.xsd, v. 1.3.
</li><li> The xs:include was dropped and the two xs:redefine's merged in FLDSkyline.xsd, v. 1.4.
</li><li> A number of typos were found and fixed.
</li></ul>
<p>Changes since the <a class="external text" href="http://www.w3.org/TR/2009/CR-rif-fld-20091001/" title="http://www.w3.org/TR/2009/CR-rif-fld-20091001/">Candidate Recommendation of October 1, 2009</a>.
</p>
<ul><li> Import's anyURIs were moved directly into location and profile.
</li><li> Appendix on <a href="#appendix-herbrand-structures" title="">Herbrand Semantic Structures</a> was added.
</li><li> Several typos fixed and clarifications added.
</li><li> Fixed List by permitting IRIMETA and aligning syntax to Expr and Atom.
</li></ul>
</div>
</div></div>
</body>
</html>