Chris Pollett > Students >
Jignesh

    ( Print View )

    [Bio]

    [Project Blog]

    [CS297 Proposal]

    [Deliverable 1]

    [Deliverable 2]

    [Deliverable 3]

    [Deliverable 4]

    [CS297 Report - PDF]

    [CS298 Proposal]

    [CS298 Presentation-PDF]

    [CS298 Report-PDF]

                          

























Deliverable-1

To Compute stable model semantics

  • I have created property file that contain rules.Read this file line by line.
  • Each rule contains head,variable list and negative variable list.For Example,x1: x2,-x3 where x1 is head,x2 is variable and x3 is negative variable.

Parsing of Rules

  • Function parseRule() is used to parse the rules of property file.It ruturns Rule.
  • Function parseHead() is used to parse the heads of all rules in property file.It returns head of rule.
  • Function parseVarlist() is used to parse the variable lists of rules.It returns variable lists.
  • Function parseNegVarlist() is used to parse the negative variable list.It returns the negative variable list.

Guessing for variables

  • Guessing True or False value for all variables
  • It guess from 0 to 2^Max_Value where Max_Value is maximum value of all the variables.
  • Here 0 means that it has all false values for all variables and 2^Max_value means that it has all true values for all variables.

Get Horn Sets

  • Function getHornSet() predicts horn sets from the guessed values of variables.
  • For example, we have two rules: x1: -x2 and x2:-x1.If I guess x2 as false then x1: is Horn set for the rules.
  • From Horn Sets,we can predict values for variables.

Check Stable Model

  • Function checkStableModel() checks existence of stable model for rules.
  • It predicts values for variables from Horn sets.If Horn set contains variable then we will predict that variable's value as true
    otherwise false for other variables that are not in Horn sets.
  • If variables has same values as guessed values of variables then Stable Model is exist otherwise Stable Model is not exist.

Example-1

Rules :

  x1:x4,-x2.
  x2:x4,-x3.
  x3:-x2.

  For i=0
  Stable Model does not exist.
  For i=1
  Stable Model does not exist.
  For i=2
  Stable Model does not exist.
  For i=3
  Stable Model does not exist.
  For i=4 
  Stable Model does not exist.
  For i=5
  Stable Model does not exist.
  For i=6
  Stable Model does not exist.
  For i=7
  Stable Model does not exist.
  For i=8
  Stable Model does not exist.
  For i=9
  Stable Model does not exist.
  For i=10
  Stable Model does not exist.
  For i=11
  Stable Model does not exist.
  For i=12 
  Stable Model does not exist.
  For i=13
  Stable Model does not exist.
  For i=14
  Stable Model does not exist.
  For i=15 
  Stable Model does not exist.

Example-2

Rules:

  x1:x4,-x2.
  x2:x4,-x3.
  x3:-x2.

  For i=0
  Stable Model Exist.