CLIPS预期的构造开始

时间:2017-05-31 03:37:28

标签: clips

我有下一个代码:

(deftemplate person
 (multislot name)
 (multislot stazh-raboty)
 (multislot date-of-birth)
 (multislot dekretny-otpusk)
 (slot kategoriya)
 (multislot dolzhnost)
 (multislot date-attestacii)
 (multislot date-kvalifikacii)
 (slot kvalif-uroven))
(deftemplate na-attestaciyu
(slot name)
)
(deftemplate real-date
(multislot rdate)
)
(assert
(person (name "Abramova Elena Viktorovna")(stazh-raboty 2017 3 2)(date-of-birth 1991 1 16)(dekretny-otpusk 2017 3 2)(kategoriya "specialist")(dolzhnost "mladshiy programmist")(kvalif-uroven 3)(date-attestacii 2017 3 2)(date-kvalifikacii 2016 7 5))
(person (name "Beketov Ilya Sergeevich")(stazh-raboty 2012 2 16)(date-of-birth 1985 3 17)(dekretny-otpusk 2012 2 16)(kategoriya "specialist")(dolzhnost "programmist")(kvalif-uroven 4)(date-attestacii 2013 4 1)(date-kvalifikacii 2014 6 1))
(person (name "Varlamov Nikita Viktorovich")(stazh-raboty 2011 12 10)(date-of-birth 1951 10 23)(dekretny-otpusk 2011 12 10)(kategoriya "glavny specialist")(dolzhnost "programmist")(kvalif-uroven 4)(date-attestacii 2016 4 1)(date-kvalifikacii 2016 6 18))
(person (name "Gorelova Irina Igorevna")(stazh-raboty 2012 12 20)(date-of-birth 1991 12 7)(dekretny-otpusk 2017 1 16)(kategoriya "specialist")(dolzhnost "programmist")(kvalif-uroven 4)(date-attestacii 2015 4 1)(date-kvalifikacii 2016 6 18))
(person (name "Demidova Nataliya Viktorovna")(stazh-raboty 2008 10 20)(date-of-birth 1989 4 11)(dekretny-otpusk 2014 8 1)(kategoriya "rukovoditel so srochnym dogovorom")(dolzhnost "veduschiy programmist")(kvalif-uroven 5)(date-attestacii 2013 4 1)(date-kvalifikacii 2016 6 18))
(person (name "Egorov Andrey Dmitrievich")(stazh-raboty 2013 2 1)(date-of-birth 1990 10 2)(dekretny-otpusk 2013 2 1)(kategoriya "pomoschnik so srochnym dogovorom")(dolzhnost "programmist")(kvalif-uroven 4)(date-attestacii 2016 4 1)(date-kvalifikacii 2016 6 18))
(person (name "Zimina Ekaterina Alekseevna")(stazh-raboty 2010 8 15)(date-of-birth 1990 7 4)(dekretny-otpusk 2013 6 1)(kategoriya "rukovodidel, osvobozhdaemy vyshestoyaschim organom")(dolzhnost "vedushiy inzhener-programmist")(kvalif-uroven 5)(date-attestacii 2013 4 1)(date-kvalifikacii 2015 6 18))
(person (name "Krasnov Pavel Petrovich")(stazh-raboty 2006 3 1)(date-of-birth 1975 8 4)(dekretny-otpusk 2006 3 1)(kategoriya "glavny specialist")(dolzhnost "vedushiy programmist")(kvalif-uroven 5)(date-attestacii 2013 4 12)(date-kvalifikacii 2011 1 20)))

但是当我尝试在CLIPS中加载文件时,我收到一条消息“[CSTR]期望构造的开头”for assert

1 个答案:

答案 0 :(得分:0)

您不能在要加载的文件中混合构造(例如deftemplate)和命令(例如assert)(请参阅CLIPS "Expected the beginning of a construct")。使用batch命令在文件中执行一系列命令(在这种情况下包括加载命令以加载构造):

(load constructs.clp)
(assert (person (name "Abramova Elena Viktorovna")
        (person (name "Beketov Ilya Sergeevich")))