app.calculateCoreObjects = function(){
    //object
    var object_id           = "object_id",
        attr_id             = app.createInstance(object_id, "attr_id"),
        attributes_id       = app.createInstance(attr_id, "attributes_id"),
        instOf_id           = app.createInstance(attr_id, "instOf_id"),
        int_id              = app.createInstance(object_id, "int_id"),
        bool_id             = app.createInstance(object_id, "bool_id"),
		true_id				= app.createInstance(bool_id, "true_id"),
        function_id         = app.createInstance(object_id, "function_id"),
        func_id             = app.createInstance(attr_id, "func_id"),
        apply_id            = app.createInstance(function_id, "apply_id"),
        arg_id              = app.createInstance(attr_id, "arg_id"),
        application_id      = app.createInstance(attr_id, "application_id"),
        logicalEquiv_id     = app.createInstance(attr_id, "logicalEquiv_id"),
        not_id              = app.createInstance(function_id, "not_id"),
        notlmb_id           = app.createInstance(bool_id, 'notlmb_id'),
        file_id             = app.createInstance(object_id, "file_id"),
        mouseInput_id       = app.createInstance(attr_id, "mouseInput_id"),
        mouse_id            = app.createInstance(object_id, "mouse_id"),
        position_id         = app.createInstance(attr_id, "position_id"),
        down_id             = app.createInstance(attr_id, "down_id"),
        lmb_id              = app.createInstance(bool_id, "lmb_id"),
        condition_id        = app.createInstance(attr_id, "condition_id"),
        graphicalRep_id     = app.createInstance(attr_id, "graphicalRep_id"),
        display_id          = app.createInstance(object_id, "display_id"),
        childElements_id    = app.createInstance(attr_id, "childElements_id"),
        geometricObject_id  = app.createInstance(object_id, "geometricObject_id"),
        circle_id           = app.createInstance(geometricObject_id, "circle_id"),
        coordPoint_id       = app.createInstance(object_id, "coordPoint_id"),
        xCoord_id           = app.createInstance(attr_id, "xCoord_id"),
        yCoord_id           = app.createInstance(attr_id, "yCoord_id"),
		centerPoint_id		= app.createInstance(attr_id, "centerPoint_id"),
        fCenterPoint_id     = app.createInstance(centerPoint_id, "fCenterPoint_id"),
		mCenterPoint_id     = app.createInstance(centerPoint_id, "mCenterPoint_id"),
        radius_id           = app.createInstance(attr_id, "radius_id"),
        radInt_id           = app.createInstance(int_id, "radInt_id"),
        fixedCenter_id      = app.createInstance(coordPoint_id, "fixedCenter_id"),
        fX_id               = app.createInstance(int_id, "fX_id"),
        fY_id               = app.createInstance(int_id, "fY_id"),
        mX_id               = app.createInstance(int_id, "mX_id"),
        mY_id               = app.createInstance(int_id, "mY_id"),
        mousePos_id         = app.createInstance(coordPoint_id, "mousePos_id"),
        nameEn_id           = app.createInstance(attr_id, "nameEn_id"),
		string_id			= app.createInstance(object_id, "string_id"),
		goName_id 			= app.createInstance(string_id, "goName_id"),
		circleName_id		= app.createInstance(string_id, "circleName_id"),
		selected_id			= app.createInstance(attr_id, "selected_id"),
		clicked_id			= app.createInstance(attr_id, "clicked_id"),
		mouseClicked_id		= app.createInstance(bool_id, "mouseClicked_id")


    //core
	app.addAttr(object_id, attributes_id)
	app.addAttr(geometricObject_id, nameEn_id)
	app.addValue(geometricObject_id, nameEn_id, goName_id)
    app.addAttr(circle_id, nameEn_id)
	app.addValue(circle_id, nameEn_id, circleName_id)

    //file
    app.addAttr(file_id, graphicalRep_id)
    app.addValue(file_id, graphicalRep_id, display_id)
	app.addPrimitive(display_id, "display")
        //display
        app.addAttr(display_id, childElements_id)
        app.addValue(display_id, childElements_id, circle_id)
            //circle
            app.addPrimitive(circle_id, 'circle')
            app.addAttr(circle_id, fCenterPoint_id)


            app.addValue(circle_id, fCenterPoint_id, fixedCenter_id)
                //condition for fixed center
                app.addAttr(fCenterPoint_id, condition_id)
                app.addValue(fCenterPoint_id, condition_id, notlmb_id)
                app.addPrimitive(notlmb_id, 'bool')
				app.addAttr(notlmb_id, logicalEquiv_id)
				app.addValue(notlmb_id, logicalEquiv_id, apply_id)
				app.addPrimitive(apply_id, 'apply')
				app.addAttr(apply_id, func_id)
				app.addValue(apply_id, func_id, not_id)
				app.addPrimitive(not_id, 'not')
				app.addAttr(apply_id, arg_id)
				app.addValue(apply_id, arg_id, lmb_id)
                //fixedCenter
                app.addAttr(fixedCenter_id, xCoord_id)
                app.addValue(fixedCenter_id, xCoord_id, fX_id)
                app.addPrimitive(fX_id, 'int', 40)
                app.addAttr(fixedCenter_id, yCoord_id)
                app.addValue(fixedCenter_id, yCoord_id, fY_id)
                app.addPrimitive(fY_id, 'int',40)
			//mouseCenter
            app.addAttr(circle_id, mCenterPoint_id)
            app.addValue(circle_id, mCenterPoint_id, file_id, [mouseInput_id, position_id])
			app.addAttr(mCenterPoint_id, condition_id)
			app.addValue(mCenterPoint_id, condition_id, lmb_id)
			app.addPrimitive(lmb_id, 'bool', ['mouse', 'lmb'])
            //radius
            app.addAttr(circle_id, radius_id)
            app.addValue(circle_id, radius_id, radInt_id)
            app.addPrimitive(radInt_id, 'int', 20)
			//selected

    app.addAttr(file_id, mouseInput_id)
    app.addValue(file_id, mouseInput_id, mouse_id)
        //mouse
        app.addAttr(mouse_id, position_id)
        app.addValue(mouse_id, position_id, mousePos_id)
            //mousePos
            app.addAttr(mousePos_id, xCoord_id)
            app.addValue(mousePos_id, xCoord_id, mX_id)
			app.addPrimitive(mX_id, 'int',['mouse', 'x'])
            app.addAttr(mousePos_id, yCoord_id)
            app.addValue(mousePos_id, yCoord_id, mY_id)
			app.addPrimitive(mY_id, 'int',['mouse', 'y'])
        app.addAttr(mouse_id, down_id)
        app.addValue(mouse_id, down_id, lmb_id)
		app.addAttr(mouse_id, clicked_id)
		app.addValue(mouse_id, clicked_id, mouse_id, ['clicked'])
}

app.objects = {
    object_id:{
		name:'object',
        id:'object_id',
		history:[{action:'ci', value:'object_id'}],
        attributes:{}
    }
}
