Rabu, 11 Mei 2016

Scope v1.1

There are changes in Scope definition.

For a statement: Predicate(x,y), there are 3 kind of Scope :
1. One-to-one deterministic relation.
    Example : Pet(x,y) means that x have y as pet.
x has possible values : {Norwegian,Dane,Brit,German,Swede}
y has possible values : {Bird,Dog,Horse,Cat,Fish}
    
    One-to-one relation means that each x only have one y value that different from other (x,y) pairs
    Example :
    If Pet(Norwegian,Bird) is true, then other x values cannot have Bird as y value,
    so Pet(Dane,Bird) is false, Pet(Brit,Bird) is false, Pet(German,Bird) is false,
    Pet(Swede,Bird) is false. Also if x = Norwegian, then the only y value that make the statement true     is Bird, so Pet(Norwegian,Dog) is false, Pet(Norwegian,Horse) is false, 
    Pet(Norwegian,Cat) is false, Pet(Norwegian,Fish) is false.
    
    Deterministic means that if only one pair is left in the unused scope (Unused scope is a scope 
    having values that haven't been used in Fact list, Fact list is a list that contains all true statements) 
    then the pair will become Fact.
    Example :
    If Pet(Norwegian,Bird) is true, Pet(Dane,Dog) is true, Pet(Brit, Horse) is true, and
    Pet(German,Cat) is true, then the unused scope is 
    Pet(x,y),
    x : {Swede}
    y : {Fish}
    Because the unused scope have only one pair of (x,y) values and the Scope is deterministic, then
    the unused scope will be converted to Fact : Pet(Swede,Fish) is true.

 2. One-to-one nondeterministic relation.
     Example : LeftSide(x,y) means that x's house is on the left of y's house.
      x: {Norwegian,Dane,Brit,German,Swede}
y: {Norwegian,Dane,Brit,German,Swede}
    One-to-one relation is already explained before in number 1.
    So if LeftSide(Norwegian, Dane) is true, then LeftSide(Norwegian, Norwegian) is false,
    LeftSide(Norwegian,Brit) is false, LeftSide(Norwegian,German) is false,
    LeftSide(Norwegian,Swede) is false, LeftSide(Dane, Dane) is false,
    LeftSide(Brit, Dane) is false, LeftSide(German, Dane) is false,
    LeftSide(Swede, Dane) is false.

    Nondeterministic means that if only one pair is left in the unused scope, the pair will not
    become Fact.
    Example :
    If LeftSide(Norwegian, Dane) is true, LeftSide(Dane, Brit) is true, 
    LeftSide(Brit, German) is true, LeftSide(German, Swede) is true, then the unused scope is
    LeftSide(x,y)
    x : {Swede}
    y : {Norwegian}
    Because the unused scope have only one pair of (x,y) values and the Scope is nondeterministic,
    then the unused scope won't be converted to Fact.

3. Many-to-many relation.
    Example : LivesNext(x,y) means that x live next to y (either on the left side or the right side)
     x: {Norwegian,Dane,Brit,German,Swede}
y: {Norwegian,Dane,Brit,German,Swede}
    Many-to-many relation means that each x value can have one or more y value as (x,y) pair,
    and also each y value can have one or more x value as (x,y) pair.
    Example :
    If LivesNext(Norwegian, Dane) is true, then LivesNext(Norwegian, Brit) can be true
    or LivesNext(German, Dane) can be true.


I'm back (to blogging) !

Well, it has been a long time not to blog, it's already 8 years passed.

I've got the logic puzzle website, http://www.logic-puzzles.org/

So far I just got 5 puzzles from the website that can be solved by my application.