CLIPS Expected beginning of construct

与世无争的帅哥 提交于 2019-12-25 10:57:08

问题


I have the next code:

(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)))

But when I try to load file in CLIPS, I get a message "[CSTR]Expected the beginning of a construct" for assert


回答1:


You can't mix constructs (such as deftemplate) and commands (such as assert) in a file you're trying to load (see CLIPS "Expected the beginning of a construct"). Use the batch command to execute a series of commands in a file (in this case including a load command to load your constructs):

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


来源:https://stackoverflow.com/questions/44275200/clips-expected-beginning-of-construct

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!